charcell 0.1.0
mode

RichText

markdown or cms content, set on the cell grid.

usage

example

code

import { RichText } from 'charcell/react';

export function RichTextExample() {
  return (
    <RichText>
      <div
        dangerouslySetInnerHTML={{
          __html:
            '<h2>the souvenir stand</h2><p>every <strong>derby</strong> night the stand sells <em>official</em> smash-a-torium loot, priced in <code>loot.txt</code>. the <a href="#stock">stock</a> is short again: <s>bunnies</s> stolen.</p><h3 id="stock">stock</h3><ul><li>we got yer hats and yer pennants</li><li>we watch the <mark>till</mark> whenever the polecats come by</li></ul><ol><li>restock the bunny value-pack</li><li>change the derby car\'s batteries</li></ol><blockquote><p>i\'m practically givin\' this loot away! what\'s a couple of bucks in exchange for a timeless memento?</p></blockquote><pre><code>hats: plenty\nbunnies: gone</code></pre><hr /><table><thead><tr><th>item</th><th>count</th></tr></thead><tbody><tr><td>pennant</td><td>300</td></tr><tr><td>bunny</td><td>0</td></tr></tbody></table>',
        }}
        style={{ display: 'contents' }}
      />
    </RichText>
  );
}

as text

at rest
## the souvenir stand

every derby night the stand sells
official smash-a-torium loot, priced in
loot.txt. the stock is short again:
bunnies stolen.

### stock

• we got yer hats and yer pennants
• we watch the till whenever the
  polecats come by

1. restock the bunny value-pack
2. change the derby car's batteries

│ i'm practically givin' this loot away!
│ what's a couple of bucks in exchange
│ for a timeless memento?

┌──────────────────────────────────────┐
│ hats: plenty                         │
│ bunnies: gone                        │
└──────────────────────────────────────┘

────────────────────────────────────────

 item     count
────────────────
 pennant  300
 bunny    0
hover
## the souvenir stand

every derby night the stand sells
official smash-a-torium loot, priced in
loot.txt. the stock is short again:
bunnies stolen.

### stock

• we got yer hats and yer pennants
• we watch the till whenever the
  polecats come by

1. restock the bunny value-pack
2. change the derby car's batteries

│ i'm practically givin' this loot away!
│ what's a couple of bucks in exchange
│ for a timeless memento?

┌──────────────────────────────────────┐
│ hats: plenty                         │
│ bunnies: gone                        │
└──────────────────────────────────────┘

────────────────────────────────────────

 item     count
────────────────
 pennant  300
 bunny    0
focus
## the souvenir stand

every derby night the stand sells
official smash-a-torium loot, priced in
loot.txt. the stock is short again:
bunnies stolen.

### stock

• we got yer hats and yer pennants
• we watch the till whenever the
  polecats come by

1. restock the bunny value-pack
2. change the derby car's batteries

│ i'm practically givin' this loot away!
│ what's a couple of bucks in exchange
│ for a timeless memento?

┌──────────────────────────────────────┐
│ hats: plenty                         │
│ bunnies: gone                        │
└──────────────────────────────────────┘

────────────────────────────────────────

 item     count
────────────────
 pennant  300
 bunny    0

props

it takes any attribute of its <div>.

slots

in react, the default slot is children and each named slot a prop of its name, a function where the slot hands values; in vue, a slot; in svelte, a snippet.

default
The markup it styles: headings, paragraphs, lists, quotes, code and tables.