Sections
Components
- AlertBanner
- AlertDialog
- Alert
- Avatar
- Badge
- Breadcrumb
- Button
- CalendarIcon
- CellLayout
- CellLink
- Checkbox
- Collapse
- ContentSwitcher
- ControlLabel
- DatePicker
- Dialog
- Divider
- Drawer
- EmptyCell
- EmptyState
- Empty
- ErrorOverlay
- FilterBar
- FilterChips
- Flex
- GridLayout
- HumanisedDate
- Icon
- InputDuration
- InputField
- Input
- Label
- Loader
- MoreActions
- NumberInput
- OutsideClickHandler
- PageLoader
- Page
- Popconfirm
- Popover
- ProgressPie
- Progress
- RadioButtonGroup
- RadioGroup
- Radio
- RelativeTime
- Resizable
- SearchInput
- Select
- SkeletonText
- Skeleton
- Space
- SquadAvatarList
- StatusPicker
- Stepper
- Switch
- TableLight
- Tabs
- Tag
- Text
- Textarea
- Toast
- Tooltip
- TriggerSelect
- Upload
import { Resizable } from "@/rl-ui";
<Resizable initialWidth={240} minWidth={160} maxWidth={400}>
<div className="p-3">Resizable content</div>
</Resizable>Examples#
Different initial widths#
import { Resizable, Text } from "@/rl-ui";
<>
<Resizable initialWidth={160} minWidth={120} maxWidth={280}>
<Text variant="body-short-01">Narrow</Text>
</Resizable>
<Resizable initialWidth={280} minWidth={160} maxWidth={420}>
<Text variant="body-short-01">Wide</Text>
</Resizable>
</>Disabled#
import { Resizable, Text } from "@/rl-ui";
<Resizable initialWidth={200} disabled>
<Text variant="body-short-01">Locked width</Text>
</Resizable>Hide content#
import { Resizable, Text } from "@/rl-ui";
<Resizable initialWidth={200} hideContent>
<Text variant="body-short-01">Hidden while collapsed</Text>
</Resizable>API#
| Prop | Type | Default | Description |
|---|---|---|---|
initialWidth | number | — | Starting width in px (required). |
minWidth | number | 0 | Minimum width. |
maxWidth | number | Infinity | Maximum width. |
offset | number | 0 | Pointer offset adjustment while dragging. |
disabled | boolean | false | Disable the resize handle. |
hideContent | boolean | false | Hide children while keeping the shell/handle. |
onChange | (width: number) => void | — | Fires while resizing. |
onResizeStart | (width: number) => void | — | Fires when a drag starts. |
onResizeStop | (width: number) => void | — | Fires when a drag ends. |
onDoubleClick | (width: number) => void | — | Double-click handle (often toggles min/max). |