10 examples of 'react native vector icons npm' in JavaScript

Every line of 'react native vector icons npm' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
95export function createIcon(i: IconDefinition): React.FunctionComponent {
96 return function I() {
97 return <Icon icon={i} size="4x" />
98 }
99}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

9var Icon = function Icon(props) {
10 var classNames = ['glyphicon', 'glyphicon-' + props.symbol];
11 if (props.className) {
12 classNames.push(props.className);
13 };
14 return _react2.default.createElement('span', { className: classNames.join(' '), 'aria-hidden': 'true' });
15};
42function Icon(props) {
43 var icon = props.icon,
44 rest = babelHelpers.objectWithoutProperties(props, ['icon']);
45
46
47 return _react2['default'].createElement('i', babelHelpers['extends']({}, (0, _omit2['default'])(rest, ['states', 'variants']), {
48 'data-icon': icon,
49 className: cx(props).build() }));
50}
99var _renderIcon = function _renderIcon(icon, iconPrefix) {
100 if (icon) {
101 return _react2.default.createElement(
102 'span',
103 { key: 'icon' },
104 _react2.default.createElement(_index.Icon, { icon: icon, prefix: iconPrefix }),
105 '\xA0'
106 );
107 }
108};
28function Icon(props) {
29 return _react2.default.createElement(
30 StyledIcon,
31 { className: props.className, size: props.size },
32 _react2.default.createElement('use', { xlinkHref: '#' + (props.symbol || 'placeholder') })
33 );
34}
23var icon = function icon(_ref) {
24 var color = _ref.color,
25 width = _ref.width,
26 height = _ref.height,
27 size = _ref.size,
28 rest = _objectWithoutProperties(_ref, ['color', 'width', 'height', 'size']);
29
30 return _react2.default.createElement(
31 'svg',
32 _extends({ fill: color, width: size || width, height: size || height }, rest, { viewBox: '0 0 2048 1792', xmlns: 'http://www.w3.org/2000/svg' }),
33 _ref2
34 );
35};
23var icon = function icon(_ref) {
24 var color = _ref.color,
25 width = _ref.width,
26 height = _ref.height,
27 size = _ref.size,
28 rest = _objectWithoutProperties(_ref, ['color', 'width', 'height', 'size']);
29
30 return _react2.default.createElement(
31 'svg',
32 _extends({ fill: color, width: size || width, height: size || height }, rest, { viewBox: '0 0 1792 1792', xmlns: 'http://www.w3.org/2000/svg' }),
33 _ref2
34 );
35};
61function IconRegistry(props) {
62 return _react2.default.createElement(
63 'div',
64 { 'data-icon-registry': true, style: { display: 'none' } },
65 props.children
66 );
67}
137function icon(symbol, color, flash, size) {
138 size = size || [35, 90];
139 color = (color || '7e7e7e').replace('#', '');
140 var icon = L.icon({
141 iconUrl: 'http://a.tiles.mapbox.com/v4/marker/pin-l' + (symbol ? "-" + symbol : '') + '+' + color + (L.Browser.retina ? '@2x' : '') + '.png?access_token=' + mapToken,
142 iconSize: [35, 90],
143 iconAnchor: [size[0] / 2, size[1] / 2],
144 popupAnchor: [0, -size[1] / 2],
145 flashIconUrl: flash ? 'http://a.tiles.mapbox.com/v4/marker/pin-l+' + color + (L.Browser.retina ? '@2x' : '') + '.png?access_token=' + mapToken : undefined
146 });
147 return icon;
148}
97renderIcon: function renderIcon(icon) {
98 var iconClassname = (0, _classnames2['default'])('FormSelect__arrows', {
99 'FormSelect__arrows--disabled': this.props.disabled
100 });
101
102 return _reactAddons2['default'].createElement('span', { dangerouslySetInnerHTML: { __html: icon }, className: iconClassname });
103},

Related snippets