List
順序付きリストと順序なしリストを表示。
インストール
import { List } from "@ginga-ui/core";順序なしリスト
順序なしリスト(ul)の使用例です。
- リストアイテム1
- リストアイテム2
- リストアイテム3
list.tsx
import { List, ListItem } from "@ginga-ui/core";
export function UnorderedExample() {
return (
<List type="unordered">
<ListItem>リストアイテム1</ListItem>
<ListItem>リストアイテム2</ListItem>
<ListItem>リストアイテム3</ListItem>
</List>
);
}順序付きリスト
順序付きリスト(ol)の使用例です。
- 最初のステップ
- 2番目のステップ
- 最後のステップ
list.tsx
import { List, ListItem } from "@ginga-ui/core";
export function OrderedExample() {
return (
<List type="ordered">
<ListItem>最初のステップ</ListItem>
<ListItem>2番目のステップ</ListItem>
<ListItem>最後のステップ</ListItem>
</List>
);
}ネストされたリスト
リストをネストして階層構造を作成します。
- 親アイテム1
- 親アイテム2
- ネストされたアイテム1
- ネストされたアイテム2
- 親アイテム3
list.tsx
import { List, ListItem } from "@ginga-ui/core";
export function NestedExample() {
return (
<List type="unordered">
<ListItem>親アイテム1</ListItem>
<ListItem>
親アイテム2
<List type="unordered">
<ListItem>ネストされたアイテム1</ListItem>
<ListItem>ネストされたアイテム2</ListItem>
</List>
</ListItem>
<ListItem>親アイテム3</ListItem>
</List>
);
}混合リスト
順序付きと順序なしを組み合わせたリストです。
- タスク管理システムの要件定義
- UI/UXデザイン
- ワイヤーフレーム作成
- デザインモックアップ
- ユーザビリティテスト
- 開発とテスト
- デプロイメント
list.tsx
import { List, ListItem } from "@ginga-ui/core";
export function MixedExample() {
return (
<List type="ordered">
<ListItem>タスク管理システムの要件定義</ListItem>
<ListItem>
UI/UXデザイン
<List type="unordered">
<ListItem>ワイヤーフレーム作成</ListItem>
<ListItem>デザインモックアップ</ListItem>
<ListItem>ユーザビリティテスト</ListItem>
</List>
</ListItem>
<ListItem>開発とテスト</ListItem>
<ListItem>デプロイメント</ListItem>
</List>
);
}Props
List
| 名前 | 型 | 既定値 | 説明 |
|---|---|---|---|
type | "ordered" | "unordered" | "unordered" | "ordered" は ol 要素、"unordered" は ul 要素で描画されます。 |
render | (props) => ReactElement | - | ルート要素を差し替える関数。受け取った props を渡した要素(next/link など)を返します。 |
上記に加えて、HTML の ul(新しいタブで開く) / ol(新しいタブで開く) 要素の属性を受け取ります。
ListItem
| 名前 | 型 | 既定値 | 説明 |
|---|---|---|---|
render | (props) => ReactElement | - | ルート要素を差し替える関数。受け取った props を渡した要素(next/link など)を返します。 |
上記に加えて、HTML の li(新しいタブで開く) 要素の属性を受け取ります。