
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@atlaskit/icon
Advanced tools
@atlaskit/icon is a package from Atlassian's Atlaskit design system that provides a collection of icons for use in React applications. It offers a variety of icons that can be easily integrated and customized within your projects.
Basic Icon Usage
This feature allows you to import and use a specific icon from the @atlaskit/icon package. The example demonstrates how to use the AtlassianIcon with a medium size.
import { AtlassianIcon } from '@atlaskit/icon';
const MyComponent = () => (
<div>
<AtlassianIcon size="medium" />
</div>
);
Customizing Icon Size
This feature allows you to customize the size of the icon. The example shows how to set the size of the AtlassianIcon to large.
import { AtlassianIcon } from '@atlaskit/icon';
const MyComponent = () => (
<div>
<AtlassianIcon size="large" />
</div>
);
Using Different Icons
This feature demonstrates how to use different icons from the @atlaskit/icon package. The example shows the usage of BitbucketIcon and JiraIcon with medium size.
import { BitbucketIcon, JiraIcon } from '@atlaskit/icon';
const MyComponent = () => (
<div>
<BitbucketIcon size="medium" />
<JiraIcon size="medium" />
</div>
);
react-icons is a popular package that provides a wide range of icons from various icon libraries such as Font Awesome, Material Design, and more. It offers a similar functionality to @atlaskit/icon but with a broader selection of icons from different sources.
fontawesome is a widely-used icon library that offers a vast collection of icons. It provides both free and pro versions, with the pro version offering additional icons and features. Font Awesome icons can be used in various frameworks and libraries, including React.
This package contains the AtlasKit icons. All icons should be consumed separately unless your build tool supports tree shaking.
This packages is licensed under the Atlassian Design Guidelines - please check the LICENSE file for more information.
Interact with a live demo of the @atlaskit/icon component.
npm install @atlaskit/icon
The @atlaskit/icon
package exports the Icon React components.
Import the component in your React app as follows:
import AkIconHome from '@atlaskit/icon/glyph/home';
ReactDOM.render(<AkIconHome />, container);
You can control the icon color via CSS:
<span style={{color: 'red'}}>
<AkIconHome />
</span>
This package provides all icons bundled in one export but unless your build tool supports tree shaking, you should import only a single icon instead of the bundled version.
import * as icons from '@atlaskit/icon';
const { BitbucketLogo } = icons;
ReactDOM.render(<BitbucketLogo />, container);
Importing a single icon (this will still bundle all of the icons in your final bundle if you don't use tree shaking):
import BitbucketLogo from '@atlaskit/icon';
ReactDOM.render(<BitbucketLogo />, container);
Adding new icons is as simple as checking out the AtlasKit repo, adding your SVG file to /packages/icon/src/icons
and running
npm run prepublish
from within the icon
package. This will clean up the SVG and generate a new src/index.jsx
file and update all the stories in storybook to use it.
NOTE: The reduced-ui-pack
package uses the icons from this package, so if you change add or remove any icons then you'll also need to update the tests in reduced-ui-pack.
Some things to look for:
/icon/src/icons/subfolder
and it will be namespaced appropriately.All icons
story. Look for any clipping or sizing issues here.All icons (usage)
story to make sure the naming has worked as expected (paths/namespacing makes sense, etc).Icons with broken fills (solid parts)
story to make sure that no parts of your svg have hardcoded colors.
fill="XXXXX"
and replace them with fill="currentColor"
.Icons that are too big (red parts)
story to show any parts of the icon that fall outside the 24x24 size that icons should fill.icon/test/indexSpec.jsx
to include your icon.Kind: global class
Properties
string
size
function
Icon interface. All icons follow this structure.
string
(Required) The icon label This is a required attribute. Omitting it will make the icon inaccessible for screen readers, etc.. The text passed will be sanitized, e.g. passed HTML will be represented as plain text.
Kind: instance property of Icon
size
(Optional) An icon size.
Defaults to an empty string (which means it uses the default size).
Kind: instance property of Icon
Default: small
function
(Optional) A handler to execute when the icon is clicked.
Defaults to a noop.
Kind: instance property of Icon
enum
Icon size values.
Kind: global enum Properties
Name | Type | Default | Description |
---|---|---|---|
small | string | "small" | small icon |
medium | string | "medium" | medium icon |
large | string | "large" | large icon |
xlarge | string | "xlarge" | xlarge icon |
* Please note that this module could have dependencies that are governed by the Atlassian Design Guidelines license which will be automatically included on install. Each dependency has a license file that indicates whether the Atlassian Design Guidelines license applies.
Let us know what you think of our components and docs, your feedback is really important for us.
Are you in trouble? Read through our contribution guidelines and raise an issue to us.
FAQs
An icon is a symbol representing a command, device, directory, or common action.
The npm package @atlaskit/icon receives a total of 135,769 weekly downloads. As such, @atlaskit/icon popularity was classified as popular.
We found that @atlaskit/icon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.