Tag is the primitive building block in Xanui Core. It wraps React.createElement, merges native props with Xanui's shorthand styling system (via useTagProps), and returns a single DOM node or custom component with a generated class name. On the server it also renders a ServerStyleTag so the collected CSS is emitted with the markup.
Tag accepts native HTML props for the rendered element (minus width/height, which are reserved for the CSS aliases) plus every field in Aliases/TagCSSProperties (src/Tag/types.ts), plus:
Note: Tag decides which props are CSS vs. DOM by checking each key against a fixed list (src/Tag/cssPropList.ts) rather than by inspecting values, so any prop name in that list is always treated as a style even if you didn't intend it as one.
tsx
import { Tag } from 'xanui-core' export const Card = ({ title, children }) => ( <Tag component="section" baseClass="card" display="flex" direction="column" gap={} px={} py={} radius="md" shadow="md" bgcolor="paper.primary" color="text.primary" hover={{ shadow: 'lg' }} > <Tag component="h3" fontSize="h5" fontWeight="h5">{title}</Tag> {children} </Tag>)useBreakpointPropstsx
import { Tag, useBreakpointProps } from 'xanui-core' const stackProps = useBreakpointProps({ direction: { xs: 'column', md: 'row' }, gap: { xs: , md: },}) <Tag component="nav" {...stackProps}> {/* children */}</Tag>