Skip to content

Container

Layout helpersMIT
View in Storybook

Width-constrained content container with sm / md / lg / xl size variants.

bun add @otfdashkit/ui

Preview

Container

Code

import { VStack } from '@otfdashkit/ui/layouts-stack'
import { Container } from '@otfdashkit/ui/layouts-container'

export function Example() {
  return (
    <VStack gap={4} className="p-4">
      {(['sm', 'md', 'lg', 'xl', 'full'] as const).map(size => (
        <Container key={size} size={size} className="border border-[hsl(var(--border))] rounded-md py-3 bg-[hsl(var(--accent))]">
          <span className="text-sm text-[hsl(var(--foreground))] font-medium">size="{size}"</span>
          <span className="text-xs text-[hsl(var(--muted-foreground))] ml-2">max-w-screen-{size !== 'full' ? size : 'none'}</span>
        </Container>
      ))}
    </VStack>
  )
}

Free with the SDK. This block ships in @otfdashkit/ui under the MIT license.

Props

Props declared in the Container source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
noPaddingbooleanfalse
size'sm' | 'lg' | 'xl' | 'md' | 'full''lg'