![]() Possible values: "sans-serif", "serif", "display", "handwriting", "monospace". categories: Array of font categories to include in the list.families: If only specific fonts shall appear in the list, specify their names in an array.Example: If the options object is, use #font-picker-main and. pickerId: If you have multiple font pickers on your site, you need to give them unique IDs which must be appended to the pickers' id attributes and the.options: Object with additional optional parameters:.defaultFamily: Font that is selected on initialization.WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.Const fontPicker = new FontPicker ( apiKey, defaultFamily, options, onChange ) IN NO EVENT SHALL THE AUTHORS ORĬOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER INĪN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ![]() IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESSįOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ![]() The above copyright notice and this permission notice shall be included in allĬopies or substantial portions of the Software. Software, and to permit persons to whom the Software is furnished to do so, Software without restriction, including without limitation the rights to use,Ĭopy, modify, merge, publish, distribute, sublicense, and/or sell copies of the This software and associated documentation files (the "Software"), to deal in the Permission is hereby granted, free of charge, to any person obtaining a copy of If you just want to watch changes to src and rebuild lib, run npm run watch (this is useful if you are working with npm link). To build, watch and serve the examples (which will also watch the component source), run npm start. A UMD bundle is also built to dist, which can be included without the need for any build system. A transpiled CommonJS version (generated with Babel) is available in lib for use with node.js, browserify and webpack. NOTE: The source code for the component is in src. To override styles in your own stylesheet you should use a more precise selector e.g div.ReactFontPicker Development ( src, lib and the build process) keyframes for ripple animation */ ripple- animation ripple /* The Material design ripple effect itself */ div. ReactFontPicker_Option :hover /* MATERIAL DESIGN: */ /* Elements that have the Material design click ripple effect */ div. ReactFontPicker_OptionsHidden /* Option (font) in the dropdown option list */. ReactFontPicker_Button :hover /* Option list (list of fonts) */. ![]() ReactFontPicker_SelectedOption /* Small dropdown arrow */. ReactFontPicker_LabelFloat /* The option that is displayed in the main field */. ReactFontPicker_Label /* Label when a font is selected (floating above the selected option) */. ReactFontPicker_Wrapper :hover /* Label when no font is selected */. ReactFontPicker /* The component UI wrapper */. Here are the component CSS classnames for quick reference: /* Component wrapper */. ReactFontPicker rule is not found in the DOM. The default one is injected dynamically if the. You can supply your own stylesheet if the default material design-style doesn't fit for you. It should take one argument which is the selected font's name as string. When a font is selected and the option list is opened again, the selected font text will display this color.Ī function that's called when a font is selected. See previews of each font in the font option list when selecting fonts The list indices should be strings e.g "Arial" The component works as standalone even if you don't supply it with any properties. Var FontPicker = require( 'react-font-picker') Ĭonsole.log(selectedFont) // Will log font name (string) when being selectedĪll properties are optional. Just require the 'react-font-picker' package which exports the component. If you use this, make sure you have already included React, and it is available as a global variable. You can also use the standalone build by including dist/react-font-picker.js in your page. The easiest way to use react-font-picker is to install it from NPM and include it in your own React build process (using Browserify, Webpack, etc). To build the examples locally, run: npm install It exports the component that works as standalone with local component state or with app state / store (like Redux). This is a ReactJS font picker component with Material Design styling as default styling.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |