Padding
Padding insets its child by a specified amount, shrinking layout constraints and inflating final size by the padding value.

Tsx

import { Padding } from '@dynshift/layr';

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
1. Basic Usage
1a. Uniform Padding
Apply equal padding to all sides:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
1b. Symmetric Padding
Different vertical and horizontal values:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
1c. Individual Sides
Specify each side independently:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
1d. All Sides (EdgeInsets.all)
Explicit all-sides syntax:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2. Common Patterns
2a. Card with Padding

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2b. Button Padding

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2c. List Item Padding

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2d. Nested Padding

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2e. Responsive Padding

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2f. Form Field Spacing

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2g. Section Spacing

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2h. Notification Badge

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2i. Chip or Tag

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2j. Modal Content

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
3. API Reference
3a. PaddingProps
PropTypeDefaultDescription
paddingnumber | EdgeInsetsRequiredPadding amount
childrenReactNodeWidget below this widget
classNamestring''Additional CSS classes
styleCSSProperties{}Custom inline styles
idstringHTML id attribute
3b. EdgeInsets Types

Tsx

// Number - all sides equal
padding={16}
// All sides explicit
padding={{ all: 16 }}
// Symmetric
padding={{ vertical: 24, horizontal: 16 }}
// Individual sides
padding={{ top: 12, right: 16, bottom: 8, left: 16 }}
4. TypeScript

Tsx

import { Padding, type PaddingProps } from '@dynshift/layr';
const CustomCard: React.FC<{ children: React.ReactNode }> = ({ children }) => {
return (
<Container decoration={{ color: '#fff', borderRadius: 12 }}>
<Padding padding={20}>
{children}
</Padding>
</Container>
);
};
Next Steps
• Centre/Centre — Center content