Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
color: var(--calcite-label-text-color, var(--calcite-color-text-1));
}

:host([layout="block"]),
:host([layout="default"]) {
.container {
@apply flex flex-col;
Expand Down
12 changes: 12 additions & 0 deletions packages/calcite-components/src/components/label/label.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ export const simple = (): string => html`
Add Notes
<calcite-text-area></calcite-text-area>
</calcite-label>
<calcite-label layout="block">
layout="block"
<calcite-input-text placeholder="I'm below the label"></calcite-input-text>
</calcite-label>
<calcite-label layout="inline">
layout="inline"
<calcite-input-text placeholder="I'm next to the label"></calcite-input-text>
</calcite-label>
<calcite-label layout="inline-space-between">
layout="inline-space-between"
<calcite-input-text placeholder="I'm right aligned"></calcite-input-text>
</calcite-label>
</div>
`;

Expand Down
5 changes: 3 additions & 2 deletions packages/calcite-components/src/components/label/label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ export class Label extends LitElement {
/** Specifies the `id` of the component the label is bound to. Use when the component the label is bound to does not reside within the component. */
@property({ reflect: true }) for: string;

/** Defines the layout of the label in relation to the component. Use `"inline"` positions to wrap the label and component on the same line. */
@property({ reflect: true }) layout: "inline" | "inline-space-between" | "default" = "default";
/** Defines the layout of the label in relation to the component. Use `"inline"` positions to wrap the label and component on the same line. [Deprecated] The `"default"` value is deprecated, use `"block"` instead. */
@property({ reflect: true }) layout: "block" | "inline" | "inline-space-between" | "default" =
Comment thread
eriklharper marked this conversation as resolved.
"default";

/** Specifies the size of the component. */
@property({ reflect: true }) scale: Scale = "m";
Expand Down
Loading