KNOW IDEA UIv0.18.0GitHub

Timeline

イベントを新しい順に並べる一覧。時刻、タイトル、本文、補足を持つ。

tsx
import { Timeline } from "knowidea-ui";

カテゴリ: Data display。同じカテゴリ: Avatar、Badge、Chip、Status、Stat、Table、List、Tooltip、Popover、CodeBlock、Kbd、Quote、Display、Jacket、Conversation、CodeEditor、DiffView

Demos

デモの数値はすべてサンプルであり、実際の値ではない。

Basic

tone でマークの色を変える。リンクがある行は、行全体がクリック領域になる。

Show code
tsx
import { Timeline, type TimelineEntry } from "knowidea-ui";​const items: TimelineEntry[] = [  { id: "1", time: "10/13 09:28", title: "公開", text: "新しいバージョンを公開した", icon: "broadcast", tone: "success", href: "#1", meta: "公開担当" },  { id: "2", time: "10/13 08:10", title: "更新", text: "設定を 3 件変更した", icon: "edit", meta: "設定担当" },  { id: "3", time: "10/12 18:02", title: "停止", text: "検査を停止した", icon: "stopped", tone: "error" },];​function Basic() {  return <div style={{ width: "100%" }}><Timeline items={items} /></div>;}

States

すべてのコンポーネントが、Empty、Loading、Error、Disabled、Focus の 5 つの状態を備える。Hover と Active は、確認用に固定して表示している。そのコンポーネントにあてはまらない状態は「対象外」とし、理由を添える。

StateAppearance
Empty

まだイベントはない

Loading
  • 読み込み中
Error

イベントを取得できなかった。

Disabled対象外。イベントの履歴は書き換えない。無効の行を持たない
Focusリンクのある行では、リンクにフォーカスが移る(リングは 2px)。上のデモを Tab で確認する

API

NameTypeDefaultDescription
itemsTimelineEntry[]-{ id, time, title, text, icon?, tone?, href?, meta? }
state"ready" | "loading" | "empty" | "error""ready"状態
emptyText / errorText / loadingTextstring-各状態のメッセージ

CSS

Classes and data attributes

NameDescription
.ki-timeline一覧
.ki-timeline__item行。data-tone: success | warn | error | info
.ki-timeline__icon、__body、__text、__title、__meta内部の要素

CSS variables

コンポーネントが参照するのは、役割を表す名前の変数だけで、素の値は参照しない。オーバーライドの方法は Overriding を参照。

VariableUsage
--color-success、--color-warn、--color-error、--color-infoマークの色
--color-text-muted時刻と補足の文字色
--font-mono時刻のフォント

Accessibility

KNOW IDEA UIv0.18.0

GitHub

ページと見出しを探す。/ か Ctrl K でどのページからも開く。

Code