Skip to content

lynx-family/lynx-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5b37e6c Β· Mar 20, 2025

History

37 Commits
Mar 20, 2025
Mar 4, 2025
Mar 2, 2025
Mar 2, 2025
Mar 12, 2025
Mar 20, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 2, 2025
Mar 9, 2025
Mar 13, 2025
Mar 4, 2025
Mar 18, 2025
Mar 18, 2025
Mar 2, 2025

Lynx Examples

This repository is intended to showcase examples of Lynx.

List of examples

  • Tutorials
  • Builtin Elements
    • event: An example shows how touch events work
    • image: An example shows how to use images
    • list: An example shows how to use reusable and scrollable container
    • scroll-view: An example shows how to use scrollable container
    • text: An example shows how to use text and inline-text
    • view: An example shows how to use view
  • Styling
    • animation: Examples for using animation
    • css: Examples for using different CSS
    • layout: Examples of the layout related styling
  • API
    • fetch: An example shows how to use fetch API
    • lazy-bundle: An example shows how code-splitting and lazy bundle works
  • Web Platform
    • basic-usage: An example shows how to use Lynx Web Platform
  • UI Components
  • A11y
  • Performance APIs
  • I18n
    • i18n: An example shows how to use i18n in Lynx

How to use

  1. First, clone the current repository to your local:
git clone git@github.com:lynx-family/lynx-examples.git
  1. Then, choose the example you need, such as the image example:
cd examples/image
  1. Install the dependencies using pnpm or other package manager, then start the project:
# Use corepack to enable pnpm
corepack enable
pnpm i
pnpm run dev
  1. You can fork the current project or copy the code from the current project to use it.

How to use examples on the lynx-website

  1. Publish your example to the npm registry.

  2. Go to the project "packages/lynx-example-packages" directory on the lynx-website.

  3. Update packages/lynx-example-packages/package.json dependencies

"dependencies": {
    "@lynx-example/xxx": "xxx",
}
  1. Install dependencies in the lynx-website root directory, then start the project:
pnpm i
pnpm run dev
  1. 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/>