# Box URL: /lynx/foundation/layout/box Source: https://github.com/daangn/seed-design/blob/dev/docs/content/lynx/foundation/layout/box.mdx Box component is the most fundamental layout surface component in Lynx. It is recommended to build layouts using the zero-runtime styling library you are using. See the [Styling Guide](/lynx/getting-started/styling) for reasons and alternative examples. ## Installation - npm: npm install @seed-design/lynx-react @seed-design/lynx-css - pnpm: pnpm add @seed-design/lynx-react @seed-design/lynx-css - yarn: yarn add @seed-design/lynx-react @seed-design/lynx-css - bun: bun add @seed-design/lynx-react @seed-design/lynx-css ## Usage ```tsx import { Box, Text } from "@seed-design/lynx-react"; export function App() { return ( Box ); } ``` `Box` renders Lynx native ``. Style props like `bg`, `p`, and `borderRadius` apply Crispy tokens by converting them directly to object style values. ## Props ## Style Props Currently, the style props exposed in `Box` are limited to a range that Lynx has validated stably. | Category | Props | | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | | Color | `bg`, `background`, `color`, `borderColor` | | Border | `borderWidth`, `borderTopWidth`, `borderRightWidth`, `borderBottomWidth`, `borderLeftWidth`, `borderRadius` and corner radius props | | Size | `width`, `minWidth`, `maxWidth`, `height`, `minHeight`, `maxHeight` | | Padding | `p`, `px`, `py`, `pt`, `pr`, `pb`, `pl` and longhand padding props | | Flex | `display`, `flexDirection`, `flexWrap`, `flexGrow`, `flexShrink`, `alignItems`, `justifyContent`, `gap` | | Positioning | `position`, `top`, `right`, `bottom`, `left`, `zIndex`, `overflowX`, `overflowY` | Since the explicit `style` prop is merged last, you can override computed styles if needed. ```tsx Override only paddingLeft directly ``` ## Differences from Web Version Lynx `Box` has the following differences from React `Box`: - Does not support `as` or `asChild`. Due to Lynx compiler limitations, native `` is rendered directly within the component file. - StyleProps that have not yet been validated in Lynx, such as `bgGradient`, `boxShadow`, `bleedX`, `bleedY`, and `unstable_transform`, are not exposed. - Does not provide margin-related shorthands. For layout spacing, use `gap` in `VStack` / `HStack` or explicit `style`. - Events use Lynx's `bindtap` series props instead of web's `onClick`.