Skip to Content
Neshel-UI
Layout

Layout recipes

Page container, responsive columns, centred content, forms, dashboards, navbars, vertical navigation and content/sidebar layouts.

Each recipe is a live, copyable module built only from the public packages.

Page container

Preview: container-sizes
Preview theme
Container size “sm”
Container size “md”
Container size “lg”
container-sizes.tsx
import { Container, Stack } from "@neshel-ui/layout";
import { Tile } from "./_tile";

const sizes = ["sm", "md", "lg"] as const;

/** Page container: a centred max-width with a responsive inline gutter. */
export default function ContainerSizes() {
  return (
    <Stack space="3">
      {sizes.map((size) => (
        <Container key={size} size={size} gutter={{ base: "2", md: "4" }}>
          <Tile>Container size “{size}”</Tile>
        </Container>
      ))}
    </Stack>
  );
}

Responsive columns

Preview: grid-columns
Preview theme
Revenue
Customers
Orders
Refunds
Visits
Conversion
grid-columns.tsx
import { Grid } from "@neshel-ui/layout";
import { Tile } from "./_tile";

const cards = ["Revenue", "Customers", "Orders", "Refunds", "Visits", "Conversion"];

/** One column on phones, two from sm, three from lg (responsive columns recipe). */
export default function GridColumns() {
  return (
    <Grid columns={{ base: 1, sm: 2, lg: 3 }} space={{ base: "2", md: "4" }}>
      {cards.map((card) => (
        <Tile key={card}>{card}</Tile>
      ))}
    </Grid>
  );
}

Centred content

Preview: center-basic
Preview theme

No projects yet

Create your first project to get started.

center-basic.tsx
import { Button } from "@neshel-ui/components";
import { Center, Stack } from "@neshel-ui/layout";
import { Heading, Paragraph } from "@neshel-ui/typography";

/** Centered content: an empty state centred on both axes inside a fixed-height region. */
export default function CenterBasic() {
  return (
    <Center className="min-h-56 rounded-lg border border-dashed border-[var(--neshel-border)]">
      <Stack space="3" alignX="center">
        <Heading as="h3" size="lg">
          No projects yet
        </Heading>
        <Paragraph tone="muted" size="sm">
          Create your first project to get started.
        </Paragraph>
        <Button size="sm">New project</Button>
      </Stack>
    </Center>
  );
}

Form layout

Preview: recipe-form
Preview theme

Billing details

recipe-form.tsx
import { Button, Input, Label } from "@neshel-ui/components";
import { Grid, Inline, Stack } from "@neshel-ui/layout";
import { Heading } from "@neshel-ui/typography";

/** Form layout: label/field pairs in a Stack, two columns from md, actions at the end. */
export default function RecipeForm() {
  return (
    <Stack as="form" space="6" aria-labelledby="recipe-form-title" className="max-w-xl">
      <Heading as="h3" size="lg" id="recipe-form-title">
        Billing details
      </Heading>
      <Grid columns={{ base: 1, md: 2 }} spaceX="4" spaceY="5">
        <Stack space="2">
          <Label htmlFor="recipe-first">First name</Label>
          <Input id="recipe-first" name="firstName" autoComplete="given-name" />
        </Stack>
        <Stack space="2">
          <Label htmlFor="recipe-last">Last name</Label>
          <Input id="recipe-last" name="lastName" autoComplete="family-name" />
        </Stack>
      </Grid>
      <Stack space="2">
        <Label htmlFor="recipe-email">Email</Label>
        <Input id="recipe-email" name="email" type="email" autoComplete="email" />
      </Stack>
      <Inline space="3" justify="end">
        <Button type="reset" variant="ghost">
          Reset
        </Button>
        <Button type="submit">Save</Button>
      </Inline>
    </Stack>
  );
}

Dashboard grid

Preview: recipe-dashboard
Preview theme

Revenue

$48,200

Active users

1,284

Open tickets

17

Uptime

99.95%

Activity

Chart placeholder

Team

Members list
recipe-dashboard.tsx
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@neshel-ui/components";
import { Grid, Stack } from "@neshel-ui/layout";
import { Heading, Text } from "@neshel-ui/typography";

const stats = [
  { label: "Revenue", value: "$48,200" },
  { label: "Active users", value: "1,284" },
  { label: "Open tickets", value: "17" },
  { label: "Uptime", value: "99.95%" },
];

/** Dashboard grid: KPI cards (1 → 2 → 4 columns) above a two-column content area. */
export default function RecipeDashboard() {
  return (
    <Stack space="6">
      <Grid columns={{ base: 1, sm: 2, xl: 4 }} space="4">
        {stats.map((stat) => (
          <Card key={stat.label} padding="sm">
            <CardHeader>
              <CardDescription>{stat.label}</CardDescription>
              <CardTitle as="p">
                <Text size="2xl" weight="bold">
                  {stat.value}
                </Text>
              </CardTitle>
            </CardHeader>
          </Card>
        ))}
      </Grid>
      <Grid columns={{ base: 1, lg: 3 }} space="4">
        <Card className="lg:col-span-2">
          <CardHeader>
            <CardTitle>Activity</CardTitle>
          </CardHeader>
          <CardContent>
            <Text tone="muted">Chart placeholder</Text>
          </CardContent>
        </Card>
        <Card>
          <CardHeader>
            <Heading as="h3" size="base">
              Team
            </Heading>
          </CardHeader>
          <CardContent>
            <Text tone="muted">Members list</Text>
          </CardContent>
        </Card>
      </Grid>
    </Stack>
  );
}

A static header built from Inline. For responsive navigation with a mobile menu, use Navbar.

Preview: recipe-navbar
Preview theme
Acme
recipe-navbar.tsx
import { Button } from "@neshel-ui/components";
import { Inline } from "@neshel-ui/layout";
import { Text } from "@neshel-ui/typography";

/**
 * Navbar layout from primitives: brand, links and actions spread with justify="between".
 * For a full responsive navbar with a mobile menu, use the Navbar component.
 */
export default function RecipeNavbar() {
  return (
    <Inline
      as="header"
      space="4"
      justify="between"
      align="center"
      className="rounded-lg border border-[var(--neshel-border)] px-4 py-3"
    >
      <Text weight="bold">Acme</Text>
      <Inline as="nav" aria-label="Main" space="4">
        <a href="#features">Features</a>
        <a href="#pricing">Pricing</a>
      </Inline>
      <Button size="sm">Sign up</Button>
    </Inline>
  );
}

Vertical navigation

A list of links for settings pages. For an application sidebar with collapse and a mobile drawer, use Sidebar.

Preview: recipe-vertical-nav
Preview theme
recipe-vertical-nav.tsx
import { Stack } from "@neshel-ui/layout";
import { Caption, Text } from "@neshel-ui/typography";

const sections = [
  { title: "Account", links: ["Profile", "Security"] },
  { title: "Workspace", links: ["Members", "Billing", "Integrations"] },
];

/** Vertical navigation built from layout primitives only (no Sidebar behaviour needed). */
export default function RecipeVerticalNav() {
  return (
    <Stack as="nav" aria-label="Settings" space="5" className="max-w-56">
      {sections.map((section) => (
        <Stack key={section.title} space="2">
          <Caption as="span">{section.title}</Caption>
          <Stack as="ul" space="1">
            {section.links.map((link, index) => (
              <li key={link}>
                <Text asChild size="sm" weight={index === 0 ? "semibold" : "regular"}>
                  <a
                    href={`#${link.toLowerCase()}`}
                    aria-current={index === 0 ? "page" : undefined}
                  >
                    {link}
                  </a>
                </Text>
              </li>
            ))}
          </Stack>
        </Stack>
      ))}
    </Stack>
  );
}

Content and sidebar

Preview: recipe-content-sidebar
Preview theme

Release notes

The article column grows and shrinks; long text keeps a comfortable measure so lines stay readable on wide screens.

recipe-content-sidebar.tsx
import { Flex, Stack } from "@neshel-ui/layout";
import { Heading, Paragraph, Text } from "@neshel-ui/typography";

/**
 * Content/sidebar layout: stacked on small screens, side by side from lg. The sidebar keeps a
 * fixed inline size; the article takes the remaining space (flex-1 utility from Tailwind).
 */
export default function RecipeContentSidebar() {
  return (
    <Flex direction={{ base: "column", lg: "row" }} space="8" alignY="start">
      <Stack as="article" space="4" className="min-w-0 flex-1">
        <Heading as="h3" size="xl">
          Release notes
        </Heading>
        <Paragraph measure="comfortable">
          The article column grows and shrinks; long text keeps a comfortable measure so lines stay
          readable on wide screens.
        </Paragraph>
      </Stack>
      <Stack as="aside" aria-label="On this page" space="2" className="lg:w-56">
        <Text weight="semibold" size="sm">
          On this page
        </Text>
        <Stack as="ul" space="1">
          <li>
            <a href="#highlights">Highlights</a>
          </li>
          <li>
            <a href="#breaking">Breaking changes</a>
          </li>
        </Stack>
      </Stack>
    </Flex>
  );
}
Edit on GitHub

On this page