This repository is intended to showcase examples of Lynx.
- Tutorials
tutorial-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 ReactLynx
- 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 view
- Styling
- API
fetch
: An example shows how to use fetch APIlazy-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
action-sheet
: An example shows how to make an ActionSheet
- A11y
accessibility
: An example shows how to make App accessibility
- Performance APIs
performance-apis
: An example shows how to listen an performance entry
- I18n
i18n
: An example shows how to use i18n 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
pnpm
or 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/>