Table of Contents
2.4.0dev

Home

  • Welcome to ⚡ Lightning
  • Install

Get started in steps

  • Basic skills
  • Intermediate skills
  • Advanced skills

Core API Reference

  • LightningApp
  • LightningFlow
  • LightningWork

Addons API Reference

  • lightning.app.components
  • lightning.app.frontend
  • lightning.app.runners
  • lightning.app.storage

More

  • Examples
  • Glossary
  • How to:
  • Overview
  • Team management
  • Production
  • Security
  • Open source
    • Overview
    • PyTorch Lightning
    • Fabric
    • Lit-GPT
    • Torchmetrics
    • Litdata
    • Lit LLaMA
    • Litserve
  • Examples
  • Glossary
  • FAQ
  • Docs >
  • How to: >
  • Add a web link
Shortcuts

Add a web link¶

Audience: Users who want to link to other pages from their app.


Add a url link¶

In this example we’ll replicate the app running here.

To add a url link to an app, simply specify it in the configure_layout method and connect the UIs. Create a file named app.py with this code:

import lightning as L

class LitApp(L.LightningFlow):
    def configure_layout(self):
        tab_1 = {
            "name": "Logger",
            "content": "https://bit.ly/tb-aasae"
        }
        tab_2 = {
            "name": "Paper",
            "content": "https://arxiv.org/pdf/2107.12329.pdf"
        }
        return tab_1, tab_2

app = L.LightningApp(LitApp())

Run the app¶

Run the app locally to see it!

lightning run app app.py

Now run it on the cloud as well:

lightning run app app.py --cloud
  • Add a web link
    • Add a url link
    • Run the app

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. Read PyTorch Lightning's Privacy Policy.