README
Storybook Addon RTL
Storybook Addon RTL allows you to switch to right-to-left flow in your stories in Storybook.
This addon has been tested with Storybook for React, Vue and Angular. It should also work in other frameworks.
Getting Started
npm i --save-dev storybook-addon-rtl
Add the addon to the addons array in .storybook/main.js
module.exports = {
/// other storybook configuration
addons: [
// other addons here
"storybook-addon-rtl",
],
};
Add the following to preview.js
:
import { initializeRTL } from 'storybook-addon-rtl';
initializeRTL();
Then write your stories normally:
import React from 'react';
import { storiesOf } from '@storybook/react';
import Component from './Component';
storiesOf('Component', module)
.add(
'default',
() => ( <Component /> ),
// Optionally include direction as story parameter
{ direction: 'rtl' }
);
Meta
- Code:
git clone https://github.com/unindented/storybook-addon-rtl.git
- Home: https://github.com/unindented/storybook-addon-rtl/
Contributors
- Daniel Perez Alvarez (unindented@gmail.com)
- Benjamin Kindle (benjaminkindle@yahoo.com)
License
Copyright (c) 2017 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.