diff --git a/docs/components/card.md b/docs/components/card.md index 1c4bcaec..52c43026 100644 --- a/docs/components/card.md +++ b/docs/components/card.md @@ -102,6 +102,8 @@ Use `` to display header element. ``` +### Actions + You may use `` with nested `` to add header actions. `` accepts following props, and emits `@click` event when user clicks on the button. It uses [``](./button) component internally. Refer to the documentation of `` for how the props work. @@ -180,7 +182,9 @@ Use `` to display generic block element. This component is usually u ``` -For combinience, `` component comes with `:space` props that lets you control the padding of the block. You may pass wither `compact` or `wide` as a value. +### Spacing + +The `` component provides a convenient way to control the padding of the block using the `:space` prop. You can choose between two values: `compact` or `wide`. ```ts interface Props { @@ -196,28 +200,25 @@ interface Props { ``` -If you need to adjust the padding responsively, you may use `--card-padding` css variable to control them. - -```vue - - - -``` +To ensure consistent spacing across the application, you should adjust the spacing based on the size of the `` component. Consider using the `compact` class for card widths smaller than `640px` and the `wide` class for larger widths. ## Footer Similar to ``, use `` to add the "footer" section of the card. `` comes with nested `` and `` to display action buttons. +```vue-html + + + + + + + + +``` + +### Actions + `` accepts following props. As same as ``, it uses [``](./button) component internally. Refer to the documentation of `` for how the props work. ```ts @@ -239,19 +240,24 @@ export interface Tooltip { } ``` +### Spacing + +Same as, ``, `` also comes with `:space` props that lets you control the padding of the block. You may pass either `compact` or `wide` as a value. + +```ts +interface Props { + space?: 'compact' | 'wide' +} +``` + ```vue-html - - - + + ... ``` + +To ensure consistent spacing across the application, you should adjust the spacing based on the size of the `` component. Consider using the `compact` class for card widths smaller than `640px` and the `wide` class for larger widths. + +It's important to align this spacing with the `` component to ensure proper alignment between the block contents and the footer contents, such as actions. diff --git a/lib/components/SCard.vue b/lib/components/SCard.vue index e0badaea..ddaee5d4 100644 --- a/lib/components/SCard.vue +++ b/lib/components/SCard.vue @@ -1,7 +1,7 @@ + diff --git a/lib/components/SCardFooterActions.vue b/lib/components/SCardFooterActions.vue index bf22a33c..d5c78e1e 100644 --- a/lib/components/SCardFooterActions.vue +++ b/lib/components/SCardFooterActions.vue @@ -10,6 +10,8 @@ justify-content: flex-end; flex-grow: 1; gap: 12px; - padding: 12px 24px; + + .SCardFooter.compact > & { padding: 12px 24px; } + .SCardFooter.wide > & { padding: 16px 32px; } }