Required files
Layouts live in your projectapp/ folder. The CLI auto-detects these files:
app/expanded.tsx(required) — default layout for standard positionsapp/featured.tsx(optional) — used for featured placementapp/featured-carousel.tsx(optional) — used when the featured layout is set to carouselapp/layout.tsx(optional) — wraps all other layoutsapp/globals.css(recommended) — shared styles
linkapp dev, linkapp build, and linkapp deploy validate that app/expanded.tsx exists and will include other layouts when the files are present. Legacy projects using app/sheet.tsx continue to work, but new projects should rename to expanded.tsx.
Root layout wrapper (optional)
app/layout.tsx runs once and wraps whichever layout is displayed:
app/layout.tsx
Expanded layout (required)
app/expanded.tsx
Featured layout (optional)
app/featured.tsx
Featured carousel (optional)
Provideapp/featured-carousel.tsx to support carousel group layouts:
app/featured-carousel.tsx
featured-carousel.tsx if it exists; otherwise it falls back to featured.tsx.
Common props
All layouts receive:- Preview props you set in
linkapp.config.ts(preview_props) - User settings defined in
settings.elements - Linktree context such as
linkUrl,theme,layout/__layout, andgroupLayoutOption(used to select featured vs featured-carousel)
AppProps<YourSettings> to get autocomplete and type safety.