# flat-radio-field

> flat ui radio select field builder

Latest version **1.0.0** (published 2013-04-06) · MOUSE license · 0 weekly downloads

## Install

```sh
npm install flat-radio-field
pnpm add flat-radio-field
yarn add flat-radio-field
bun add flat-radio-field
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2013-04-06 |
| First published | 2013-04-06 |
| Weekly downloads | 0 |
| License | MOUSE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | johnnyscript.us |
| Maintainers | johnnyscript |
| Keywords | flat, ui, browserify, radio, select |

## Links

- npm: https://www.npmjs.com/package/flat-radio-field
- Repository: git@github.com:NHQ/flat-radio-field
- npm.io page: https://npm.io/package/flat-radio-field

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2013-04-06

## README

# flat radio field

A mobile/touch optimized radio select in the style of Flat UI. For use with NPM modules Browserify and brfs.

```
npm install flat-radio-field
```

To play with this repo, or see the example
```
npm install -g browserify opa
git clone [this repo]
cd [this repo]
opa -e example.js -n
```
## Usage

It's a function that will return a fieldset HTMLElement with your options. Default width is 100%, so you should probably put in a container div, or set the width value on the fieldset.

Actual radio inputs are used, so this will/should work inside a normal form element.

It takes an options/config object:
```
legend: title of the options list (used in the legend Element)
name: the name for the value all the radios represent (the key for the field)
options: an array of objects with at least a 'value' param (and optionally a 'checked' param)
color: the overall color // optional
legendColor: just the text color of the legend // optional
fontColor: font colors for radio options // optional
selected: color to fill selected radios with // optional
```

## Example
from example.js
```js
var radioField = require('./flatradio.js');

var config = {legend: 'love me with a', name: 'osc-type', options: [{value: 'sine'}, {value: 'triangle'}, {value: 'saw', checked: true}]}

var fieldset = radioField(config)

var div = document.createElement('div');

div.style.width = '220px';

div.appendChild(fieldset)

document.body.appendChild(div);
```

---
_Source: https://npm.io/package/flat-radio-field · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
