Skip to Content
Neshel-UI
Configuration

Breakpoints

The breakpoint configuration schema and the augmentable BreakpointRegistry type shared by all packages.

neshel.config.ts
import { defineConfig } from "@neshel-ui/config";

export default defineConfig({
  breakpoints: {
    mode: "extend",
    values: { phone: "30rem", tablet: "52rem" },
    tailwind: true,
  },
});

BreakpointsInput

Consumer-defined responsive breakpoints (feature 004, contracts/breakpoints.md).

BreakpointsInput
PropTypeDefaultDescription
mode"extend" | "replace"—extend keeps the defaults (sm, md, lg, xl, 2xl) and adds names; replace uses only values.
tailwindboolean—Also emit Tailwind CSS v4 @theme breakpoints in the generated stylesheet.
values(required){ readonly [name: string]: BreakpointWidth; }—Name → min-width threshold. Names: lower camelCase (phoneXL); widths: distinct rem.

BreakpointWidth

A breakpoint threshold in rem, e.g. "48rem". Checked by the neshel CLI.

type BreakpointWidth = `${number}rem`

DefaultBreakpointName

Default breakpoint names, ascending: sm 40rem, md 48rem, lg 64rem, xl 80rem, 2xl 96rem.

type DefaultBreakpointName = "sm" | "md" | "lg" | "xl" | "2xl"

BreakpointRegistry and BreakpointName

BreakpointName is the union of names accepted by responsive props (besides base). It is derived from the augmentable BreakpointRegistry interface: empty by default (so the defaults sm md lg xl 2xl apply), augmented by the declarations that neshel generate writes:

neshel.generated.d.ts
export {};
declare module "@neshel-ui/config" {
  interface BreakpointRegistry {
    readonly names: "phone" | "tablet" | "sm" | "md" | "lg" | "xl" | "2xl";
  }
}

BreakpointName

Breakpoint names accepted by responsive props (besides base): the configured names when the generated declarations are part of the program, otherwise the defaults sm md lg xl 2xl. The conditional type replaces the whole union, so replace mode removes the default names.

type BreakpointName = BreakpointRegistry extends { readonly names: infer Names extends string; } ? Names : DefaultBreakpointName

BreakpointRegistry

Registry of the application's breakpoint names (ADR 0010). Empty by default; the declarations written by neshel generate augment it with names: ``ts declare module "@neshel-ui/config" { interface BreakpointRegistry { readonly names: "tablet" | "desktop" } } `` Declared here (not re-exported) so module augmentation targets the package entry directly.

type BreakpointRegistry = BreakpointRegistry

Layout, typography and components declare @neshel-ui/config as a peer dependency solely for this type. Full workflow: Custom breakpoints.

Edit on GitHub

On this page