Function
Static Public Summary | ||
public |
Email(props: *): ReactElement The |
|
public |
Submit(props: *): ReactElement The |
|
public |
TinyLetter(props: object): ReactElement The TinyLetter component acts as a wrapper for the subscription form. |
Static Public
public Email(props: *): ReactElement source
import Email from 'react-tinyletter/src/components/Email/index.js'
The Email
component is a very minimal input element.
It sets the type to email
and the placeholder
to the value of the placeholder
prop. If no placeholder
is set, it will set the placeholder to email@site.com
.
Params:
Name | Type | Attribute | Description |
props | * |
Return:
ReactElement | form wrapper markup |
public Submit(props: *): ReactElement source
import Submit from 'react-tinyletter/src/components/Submit/index.js'
The Submit
component is a very minimal form submit
button. It sets the type to submit
and the value
to the value of the title
prop. If no title is set,
it will set the title to Subscribe
.
Params:
Name | Type | Attribute | Description |
props | * |
Return:
ReactElement | form wrapper markup |
public TinyLetter(props: object): ReactElement source
import TinyLetter from 'react-tinyletter/src/components/TinyLetter/index.js'
The TinyLetter component acts as a wrapper for the subscription form. It automatically populates itself with input fields if no children are added. You can also manually add the children elements. Below are some examples of the various implementations.
Using the auto-injected inputs
{ TinyLetter } from 'react-tinyletter';
...
<TinyLetter list="YourTinyLetterUsername"/>
Using the included input components
import { TinyLetter, Email, Submit } from 'react-tinyletter';
...
<TinyLetter list="YourTinyLetterUsername">
<Email/>
<Submit/>
</TinyLetter>
Using input primitives
import { TinyLetter } from 'react-tinyletter';
...
<TinyLetter list="YourTinyLetterUsername">
<input type="email"/>
<input type="submit" value="Subscribe"/>
</TinyLetter>
You need not worry about assigning the name
or id
properties on form inputs, they will automatically get
added by the TinyLetter
component. However, make
sure that you use the correct type
on your input fields
if using primitives, as the type
is how the TinyLetter
component is able to determine which input
is which.
Params:
Name | Type | Attribute | Description |
props | object | jsx attributes |
Return:
ReactElement | form wrapper markup |