systomic

Annotations

Components describe their own contract in a comment above the declaration. Call sites in any file, or any package, are checked against it.

@systomic-allow and @systomic-disallow

What a call site may pass. @systomic-allow <prop> <values...> lists what a prop may take, @systomic-disallow <prop> <values...> what it may not. Props without a line aren’t checked. Used by component-overrides.

Often it’s easier to say what’s off limits. Everything except sizing:

Both on one prop take the allowed values minus the disallowed ones. Layout, but no heights:

@systomic-disallow <prop> * forbids the prop entirely, like @systomic-allow <prop> none. Repeated lines for the same prop add up.

Values

Value Meaning
* Everything.
none Nothing (only with allow: the prop can’t be passed).
placement, sizing, layout A group, see below. Only for className, style and xstyle.
w-*, margin*, h-8 A glob or exact class / CSS property.
neutral danger Literal values, for any other prop.

Groups

Group Tailwind classes (className) CSS properties (style, xstyle, CSS modules)
placement Margin: m-*, mx-*, my-*, mt-*, mr-*, mb-*, ml-*, ms-*, me-*
Position: static, fixed, absolute, relative, sticky
Inset: inset-*, inset-x-*, inset-y-*, inset-s-*, inset-e-*, top-*, right-*, bottom-*, left-*, start-*, end-*
Stacking: z-*
Self-alignment: self-*, justify-self-*, place-self-*
Grid/flex child: order-*, col-span-*, col-start-*, col-end-*, row-span-*, row-start-*, row-end-*, col-auto, row-auto, col-span-full, row-span-full, grow, shrink, basis-*, flex-1, flex-auto, flex-initial, flex-none
Display toggles: hidden, block, inline-block, inline, contents
margin*, position, inset*, top*, right*, bottom*, left*, zIndex, order, display, alignSelf, justifySelf, placeSelf, gridArea*, gridColumn*, gridRow*, flex, flexGrow, flexShrink, flexBasis
sizing w-*, h-*, size-*, min-w-*, min-h-*, max-w-*, max-h-*, aspect-* width, height, minWidth, minHeight, maxWidth, maxHeight, inlineSize, blockSize, minInlineSize, minBlockSize, maxInlineSize, maxBlockSize, aspectRatio
layout placement + sizing placement + sizing

Not in any group, so only reachable through * or a glob: padding, gap, colors, typography, borders, radius, shadows, opacity, transforms, transitions. These are what a component decides itself.

Classes are matched without variants, ! and a leading - (md:-mt-2 counts as mt-2). CSS properties are matched in camelCase (margin-top counts as marginTop). CSS-module classes are checked by the declarations behind them (.big { height: 4rem } is sizing).

@systomic-parts

The parts a composable component needs. | lists alternatives. Used by required-parts.

@systomic-overlay

Marks an app component as an overlay that must stay mounted and open through open. Components ending in Dialog, Modal, Sheet, Drawer or Popover are overlays without it. Used by no-conditional-overlay.

Across files and packages

Annotations are read where the component is declared: relative and aliased imports, barrel files, default exports and packages in node_modules.

  • Workspace packages: add a source condition to exports that points at the sources, and annotations are read straight from the .tsx files.
  • Published packages: annotations are read from the .d.ts files. tsc keeps JSDoc comments unless removeComments is on.

After changing an annotation, editors update call sites in other files when those are linted again. CI is not affected.

Esc