툴바 (Toolbar)
Toolbar는 화살표 키 내비게이션이 가능한 인터랙티브 컨트롤을 위한 컨테이너예요.
출처: HeroUI Toolbar
본문
사용 방법 (Usage)
import { Toolbar } from '@heroui/react';
{
"preview": "toolbar-basic"
}
예제 (Examples)
세로 (Vertical)
{
"preview": "toolbar-vertical"
}
부착형 (Attached)
{
"preview": "toolbar-attached"
}
ButtonGroup 함께 사용 (With ButtonGroup)
{
"preview": "toolbar-with-button-group"
}
커스터마이징 (Customization)
Tailwind CSS
{
"preview": "toolbar-custom-styles"
}
글로벌 CSS (Global CSS)
Toolbar 컴포넌트 클래스를 커스터마이징하려면 @layer components 지시문을 사용할 수 있어요.
더 알아보기.
@layer components {
.toolbar {
@apply gap-4 rounded-lg bg-surface p-3;
}
}
스타일 참조 (Styling Reference)
HeroUI는 컴포넌트 변형과 상태를 재사용하고 커스터마이징하기 쉽도록 BEM 방법론을 따르고 있어요.
CSS 클래스 (CSS Classes)
Toolbar 컴포넌트는 다음 CSS 클래스를 사용해요 (소스 스타일 보기):
.toolbar- 기본 컨테이너.toolbar--horizontal- 가로 방향 (기본값).toolbar--vertical- 세로 방향.toolbar--attached- 배경이 표면이고 모서리가 완전히 둥근 부착형 변형
API 참조 (API Reference)
Toolbar
React Aria Toolbar를 상속해요.
| Prop | Type | Default | Description |
|---|---|---|---|
isAttached |
boolean |
false |
Whether the toolbar has a surface background with full rounding |
orientation |
"horizontal" | "vertical" |
"horizontal" |
The orientation of the toolbar |
aria-label |
string |
- | An accessible label for the toolbar |
aria-labelledby |
string |
- | The id of an element that labels the toolbar |
children |
React.ReactNode | (values: ToolbarRenderProps) => React.ReactNode |
- | Content or render prop |
className |
string | (values: ToolbarRenderProps) => string |
- | Additional CSS classes |
렌더 props (Render Props)
렌더 prop 패턴을 사용할 때 다음 값이 제공돼요:
| Prop | Type | Description |
|---|---|---|
orientation |
"horizontal" | "vertical" |
The current orientation of the toolbar |
더 알아보기 (Learn more)
HeroUI Toolbar에 대해 더 알아보려면 공식 문서를 확인해 주세요.