Skip to content

Commit

Permalink
docs: add notes about cellpadding and cellspacing
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Oct 15, 2024
1 parent c0f3a2f commit a58993f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/components/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const Email = () => {
};
```

::: info
Though the `Container` component wraps a `<table>` element, it has a specific use-case and does not support setting `cellPadding` or `cellSpacing`. If attempting to use `Container` as a table, please consider using a `<table>` element or a combination of `Row` and `Column`.
:::

## Component Props

```ts
Expand All @@ -36,5 +40,5 @@ disableDefaultStyle?: boolean;
If `true`, instructs the component _not to add_ default `style` properties to the component. This can be useful when attempting to override default styles with `Tailwind` or class names.

::: tip
This component also expresses all of the [Common Component Props](https://react.dev/reference/react-dom/components/common) for `ComponentProps<'table'>`.
This component also expresses all of the [Common Component Props](https://react.dev/reference/react-dom/components/common) for `ComponentProps<'table'>` except for `cellPadding` and `cellSpacing`.
:::
4 changes: 4 additions & 0 deletions docs/components/row.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const Email = () => {
};
```

::: info
Though the `Row` component wraps a `table` element, it is not designed to identically mimic a `table`, rather provide a visual row element that has maximum email client compatibility. Setting `cellPadding` or `cellSpacing` on a `Row` component can achieve similar results to using a custom `table` element, but it's not recommended. For custom behavior and for needs like `cellPadding` it's recommended to use a `table` element instead of `Row`.
:::

## Component Props

```ts
Expand Down
8 changes: 6 additions & 2 deletions docs/components/section.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 'Section'
description: 'Creates section bordaries that can be formatted with columns and rows'
description: 'Creates section boundaries that can be formatted with columns and rows'
slug: section
type: component
---
Expand Down Expand Up @@ -40,6 +40,10 @@ const Email = () => {
};
```

::: info
Though the `Section` component wraps a `<table>` element, it's not designed to mimic a `table` and has a specific use for email client compatibility and does not support setting `cellPadding` or `cellSpacing`. If attempting to use `Section` as a table, please consider using a `<table>` element. If using `Row` and `Column` with a `Section` and the need arises to set either `cellPadding` or `cellSpacing`, please set those properties on the appropriate `Row` component(s).
:::

## Component Props

This component has no custom props, but expresses all of the [Common Component Props](https://react.dev/reference/react-dom/components/common) for `ComponentProps<'table'>`.
This component has no custom props, but expresses all of the [Common Component Props](https://react.dev/reference/react-dom/components/common) for `ComponentProps<'table'>` except for `cellPadding` and `cellSpacing`.

0 comments on commit a58993f

Please sign in to comment.