charcell 0.1.0
mode

InlineMessage

a message that names its kind in words: info, success, warning or error.

usage

example

code

import { InlineMessage } from 'charcell/react';

export function InlineMessageExample() {
  return (
    <InlineMessage context="warning" title="roadblocks ahead">
      police are turning everyone around on highway 9.
    </InlineMessage>
  );
}

as text

at rest
warning: roadblocks ahead
         police are turning everyone
         around on highway 9.

props

context'information' | 'success' | 'warning' | 'error'= 'information'
The kind of message, printed bold as the line's prefix (info: for information, error: and so on).
titlestring
A bold first row, above the message in the default slot.
translationsInlineMessageTranslations
The word each context prints before its colon (information prints info by default).
rolestring
Overrides the role the context picks (alert for an error, status otherwise).

it also takes any other 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 rows under the message's first.