Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

docs(Grid): align and justify leave the browser default when unset (#9347)

Cindy Zhang7c4e5fac0c35
diff --git a/.changeset/grid-align-justify-default-docs.md b/.changeset/grid-align-justify-default-docs.md
new file mode 100644
index 0000000000..9d933c6f4c
--- /dev/null
+++ b/.changeset/grid-align-justify-default-docs.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/core': patch
+---
+
+[docs] Grid's `align` and `justify` docs no longer claim a `'stretch'` default. Unset, they leave the browser default, `normal`, which stretches items that have no natural size or aspect ratio. Rendering is unchanged.
+
+@cixzhang
diff --git a/packages/core/api-report.md b/packages/core/api-report.md
index 0e61e81d38..ff6d4fa9c4 100644
--- a/packages/core/api-report.md
+++ b/packages/core/api-report.md
@@ -1210,13 +1210,13 @@ component FormLayout(props: FormLayoutProps)
prop xstyle?: StyleXStyles
inherits AriaAttributes, DOMAttributes, HTMLAttributes
component Grid(props: GridProps)
- prop align?: GridAlignment = 'stretch'
+ prop align?: GridAlignment
prop children?: ReactNode
prop columnGap?: SpacingStep
prop columns?: GridColumns
prop gap?: SpacingStep
prop height?: SizeValue
- prop justify?: GridAlignment = 'stretch'
+ prop justify?: GridAlignment
prop maxWidth?: SizeValue
prop minHeight?: SizeValue
prop ref?: React.Ref<HTMLDivElement>
diff --git a/packages/core/src/Grid/Grid.doc.mjs b/packages/core/src/Grid/Grid.doc.mjs
index f082abcb95..fec52b5c4b 100644
--- a/packages/core/src/Grid/Grid.doc.mjs
+++ b/packages/core/src/Grid/Grid.doc.mjs
@@ -106,14 +106,14 @@ export const docs = {
{
name: 'align',
type: "'start' | 'center' | 'end' | 'stretch'",
- description: 'Vertical alignment of items.',
- default: "'stretch'",
+ description:
+ 'Vertical alignment of items (`align-items`). Unset leaves the browser default, `normal`, which stretches items that have no natural size or aspect ratio.',
},
{
name: 'justify',
type: "'start' | 'center' | 'end' | 'stretch'",
- description: 'Horizontal alignment of items.',
- default: "'stretch'",
+ description:
+ 'Horizontal alignment of items (`justify-items`). Unset leaves the browser default, `normal`, which stretches items that have no natural size or aspect ratio.',
},
{
name: 'children',
diff --git a/packages/core/src/Grid/Grid.tsx b/packages/core/src/Grid/Grid.tsx
index 3c6077b2f7..b9ec203c71 100644
--- a/packages/core/src/Grid/Grid.tsx
+++ b/packages/core/src/Grid/Grid.tsx
@@ -129,14 +129,16 @@ export interface GridProps extends BaseProps<HTMLDivElement> {
rowHeight?: number;
/**
- * Vertical alignment of grid items (align-items).
- * @default 'stretch'
+ * Vertical alignment of grid items (align-items). Unset leaves the browser
+ * default, `normal`, which stretches items that have no natural size or
+ * aspect ratio.
*/
align?: GridAlignment;
/**
- * Horizontal alignment of grid items (justify-items).
- * @default 'stretch'
+ * Horizontal alignment of grid items (justify-items). Unset leaves the browser
+ * default, `normal`, which stretches items that have no natural size or
+ * aspect ratio.
*/
justify?: GridAlignment;