Tag 태그
표시와 선택에 사용하는 태그입니다.
기본 사용법
기본 사용법
기본 태그주요 태그성공 태그둥근 태그외곽선 태그수묵중국풍컴포넌트 라이브러리
import { useState } from 'react'
import { LhTag } from '@lh-ui/react'
export default function Demo() {
const [tags, setTags] = useState(['수묵', '중국풍', '컴포넌트 라이브러리'])
const handleClose = (tag: string) => {
setTags((prev) => prev.filter((item) => item !== tag))
}
return (
<>
<LhTag>기본 태그</LhTag>
<LhTag type="primary">주요 태그</LhTag>
<LhTag type="success">성공 태그</LhTag>
<LhTag type="warning" round>둥근 태그</LhTag>
<LhTag type="danger" hit>테두리 태그</LhTag>
{tags.map((tag) => (
<LhTag key={tag} closable onClose={() => handleClose(tag)}>
{tag}
</LhTag>
))}
</>
)
}
Tag Props
| 프로퍼티 | 설명 | 타입 | 옵션 | 기본값 |
|---|---|---|---|---|
| type | 유형 | 'text' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | — | 'text' |
| size |