Skip to main content
Designkufu

smarthr-ui-stack

Stackは、要素を垂直方向に並べるためのレイアウトコンポーネントです。ページの「セクション」や「ブロック」、段落、フォーム項目などあらゆる要素を垂直に積み重ねて配置するときに使います。

Stars
30
Source
kufu/smarthr-design-system
Updated
2026-05-29
Slug
kufu--smarthr-design-system--smarthr-ui-stack
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/kufu/smarthr-design-system/HEAD/plugins/smarthr-design-system/skills/smarthr-ui-stack/SKILL.md -o .claude/skills/smarthr-ui-stack.md

Drops the SKILL.md into .claude/skills/smarthr-ui-stack.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

要素を垂直方向に並べるためのレイアウトコンポーネントです。ページの「セクション」や「ブロック」、段落、フォーム項目などあらゆる要素を垂直に積み重ねて配置するときに使います。

Every Layout(https://every-layout.dev/)のStackを参考にしています。

import

import { Stack } from 'smarthr-ui'

Props

Props 名 デフォルト値 必須 説明
inline boolean false - -
gap Gap 1 - -
align "center" | "start" | "flex-start" | "end" | "flex-end" | "baseline" | "stretch" - - -

実装ルール

best-practice-for-layouts

smarthr-ui/Layoutsに属するコンポーネント(Center,Cluster,Container,Reel,Stack,Sidebar)の利用方法をチェックするルールです。

❌ NG:

// divに置き換え可能 or Stackの内部的なstyleを期待した実装になってしまうためNG
<Stack gap={0}>
  <Any />
  <Any />
</Stack>
// Heading, FormControlのlabel, Fieldsetのlegendにsmarthr-ui/Layoutsに属するコンポーネントを設置するとエラー
<Heading><Cluster><AnyIcon /><Text /></Cluster></Heading>
<FormControl label={{
  text: <Text prefixIcon={<AnyIcon />}>hoge</Cluster>
}} />
<Fieldset legend={
  <Stack>
    <Text />
    <SubText />
  </Stack>
} />

✅ OK:

// Stackはas="span"、もしくはforwardedAs="span"を指定すれば利用できる
<Fieldset legend={
  <Stack as="span">
    <Text />
    <SubText />
  </Stack>
} />
<FormControl label={{
  text: (
   <AnyStack forwardedAs="span">
     <Text />
     <SubText />
   </AnyStack>
  ),
}} />

詳細は eslint-plugin-smarthr の各ルール README を参照してください。

使い方チェックリスト

使い方チェックリスト(Layer 3)は設定されていません。