@neynar/ui
Version:
React UI component library built on shadcn/ui and Tailwind CSS
132 lines (110 loc) • 2.66 kB
Markdown
# Span
**Type**: component
Span - Inline text component for text fragments and styling Generic inline element for styling text fragments within other content. Supports all typography variants while maintaining inline display behavior.
## JSX Usage
```jsx
import { Span } from '@neynar/ui';
<Span
variant={value}
color={value}
align={value}
transform={value}
weight={value}
htmlFor="value"
asChild={true}
italic={true}
underline={true}
strikethrough={true}
truncate={true}
srOnly={true}
className="value"
>
{/* Your content here */}
</Span>
```
## Component Props
### variant
- **Type**: `| "heading"
| "subheading"
| "body"
| "bodyEmphasized"
| "details"
| "field"
| "code"
| "microcopy"
| "tableCell"
| "tableHeader"`
- **Required**: No
- **Description**: No description available
### color
- **Type**: `| "default"
| "muted"
| "accent"
| "destructive"
| "success"
| "warning"`
- **Required**: No
- **Description**: No description available
### align
- **Type**: `"left" | "center" | "right" | "justify"`
- **Required**: No
- **Description**: No description available
### transform
- **Type**: `"uppercase" | "lowercase" | "capitalize"`
- **Required**: No
- **Description**: No description available
### weight
- **Type**: `"normal" | "medium" | "semibold" | "bold"`
- **Required**: No
- **Description**: No description available
### htmlFor
- **Type**: `string`
- **Required**: No
- **Description**: No description available
### asChild
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### italic
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### underline
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### strikethrough
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### truncate
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### srOnly
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### className
- **Type**: `string`
- **Required**: No
- **Description**: No description available
### children
- **Type**: `React.ReactNode`
- **Required**: No
- **Description**: No description available
## Examples
```tsx
// Inline text styling
<p>
Regular text with <Span color="accent" weight="semibold">highlighted</Span> content
</p>
// Small inline details
<Span variant="details" color="muted">
Updated 5 minutes ago
</Span>
// Inline code reference
<Span variant="code" className="bg-muted px-1 rounded">
onClick
</Span>
```