This repository is intended to showcase examples of Lynx.
- Benchmarks
7guis: The 7GUIs benchmark β Counter, Temperature Converter, Flight Booker, Timer, CRUD, Circle Drawer, Cells
- Tutorials
hello-world: A minimal hello world exampletutorial-gallery: An example shows how to use discoverPagetutorial-bankcards: An example shows how to use Lynx in bankcards projectcomposing-elements: An example shows how to composing elements in ReactLynxdesign-guide: An example demonstrating design with Lynx capabilities
- Builtin Elements
event: An example shows how touch events workimage: An example shows how to use imageslist: An example shows how to use reusable and scrollable containerscroll-view: An example shows how to use scrollable containertext: An example shows how to use text and inline-textview: An example shows how to use viewframe: An example shows how to use framepage: An example shows how to use page in Lynxrefresh: An example shows how to use<refresh>in Lynxscroll-coordinator: An example shows how to use<scroll-coordinator>in Lynxviewpager: An example shows how to use<viewpager>in Lynxtitle-bar-view: An example shows how to use<title-bar-view>in Lynxnative-element: An example about using native element in Lynx
- XElement
- Styling
animation: Examples for using animationcss: Examples for using different CSSlayout: Examples of the layout related stylingtailwindcss: A settings UI with runtime theme switching using Tailwind CSS and CSS variables
- API
fetch: An example shows how to use fetch APIlazy-bundle: An example shows how code-splitting and lazy bundle worksexternal-bundle: An example shows how to use external bundle in Lynxelement-manipulation: An example shows how to manipulate elements in Lynxlynx-api: An example shows how to use Lynx APIsmain-thread: An example shows how to use main thread scriptslocal-storage: An example shows how to use local storage in Lynxnetworking: An example shows Lynx networking abilitiesreact-lifecycle: An example shows ReactLynx lifecycle
- Web Platform
basic-usage: An example shows how to use Lynx Web Platform
- UI Components
action-sheet: An example shows how to make an ActionSheetdesktop: Desktop-oriented cursor demos withcursorandmouse-cursorentriesswiper: An example shows how to use main thread script for interaction
- A11y
accessibility: An example shows how to make App accessibility
- Performance
performance-apis: An example shows how to listen an performance entryifr: An example about Instant First-Frame Rendering (IFR) in Lynx
- I18n
i18n: An example shows how to use i18n in Lynx
- Third-party Integrations
with-solidjs: An example shows how to use Lynx with SolidJSzustand: An example shows how to use zustand in Lynxtanstack-router: An example shows how to use TanStack Router in Lynx
- First, clone the current repository to your local:
git clone git@github.com:lynx-family/lynx-examples.git- Then, choose the example you need, such as the image example:
cd examples/image- Install the dependencies using
pnpmor other package manager, then start the project:
# Use corepack to enable pnpm
corepack enable
pnpm i
pnpm run dev- You can fork the current project or copy the code from the current project to use it.
-
Publish your example to the npm registry.
-
Go to the project "packages/lynx-example-packages" directory on the lynx-website.
-
Update packages/lynx-example-packages/package.json dependencies
"dependencies": {
"@lynx-example/xxx": "xxx",
}- Install dependencies in the lynx-website root directory, then start the project:
pnpm i
pnpm run dev- Use it in your MDX files:
import { Go } from "@lynx";
<Go
example="xxx"
defaultFile="src/App.tsx"
img="xxx-example-preview.png"
/>;For more details please see <Go/>