storybook-addon-rtl-direction
Version:
A Storybook tool add-on to toggle html dir attribute between LTR and RTL.
16 lines (15 loc) • 459 B
JavaScript
import { addons, types } from "@storybook/addons";
import { ADDON_ID, TOOL_ID } from "../constants";
import { Tool } from "../Tool"; // Register the addon
addons.register(ADDON_ID, function () {
// Register the tool
addons.add(TOOL_ID, {
type: types.TOOL,
title: "RTL direction",
match: function match(_ref) {
var viewMode = _ref.viewMode;
return !!(viewMode && viewMode.match(/^(story|docs)$/));
},
render: Tool
});
});