# MOKO resources 0.21 with Compose Multiplatform support

DevFeed: [MOKO resources 0.21 with Compose Multiplatform support](<https://devfeed.tech/articles/moko-resources-0-21-with-compose-multiplatform-support-23909.md>)

Original publisher: [Read original article](<https://medium.com/icerock/moko-resources-0-21-with-compose-multiplatform-support-462d8b11116b?source=rss----b74ae24564e---4>)

Author: Aleksey Mikhailov

Published: 2023-03-25T15:49:09Z

Content type: article

Language: en

Sources: [IceRock Development - Medium](<https://devfeed.tech/sources/icerock-development-medium.md>)

Topics: [compose-multiplatform](<https://devfeed.tech/topics/compose-multiplatform.md>), [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Library](<https://devfeed.tech/topics/library.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [build](<https://devfeed.tech/tags/build.md>), [compose-multiplatform](<https://devfeed.tech/tags/compose-multiplatform.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ios](<https://devfeed.tech/tags/ios.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [library](<https://devfeed.tech/tags/library.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

This tutorial explains how MOKO resources 0.21.0 adds Compose Multiplatform support to a Kotlin Multiplatform resource library. It demonstrates accessing images, fonts, localized strings, colors, assets, and files from shared code, including a simple UI example.

## Source excerpt

MOKO resources is a multiplatform Kotlin library that provides a convenient way to access resources like images, colors, strings, and fonts in your Kotlin Multiplatform projects. With the release of version 0.21.0, MOKO resources now includes support for Compose Multiplatform, allowing developers to easily access resources across all supported platforms. One of the key benefits of using MOKO resources with Compose Multiplatform is the ability to easily use fonts, colors, and images in your UI. With the fontFamilyResource, colorResource, and painterResource functions provided by MOKO resources, it's easy to reference resources from your shared code. In this article, we'll take a closer look at how to use MOKO resources with Compose Multiplatform, and how it can help you build better multiplatform applications. Usage MOKO resources provides several functions for accessing resources like images, colors, strings, and fonts. Here's a brief overview of how to use each of these functions: ImageResource To display an image in your Compose Multiplatform UI, use the painterResource function with the ID of the image resource you want to use: Image( painter = painterResource(MR.images.logo), contentDescription = null )FontResource To use a custom font in your Compose Multiplatform UI, use the fontFamilyResource function: Text( text = "Hello, World!", fontFamily = fontFamilyResource(MR.fonts.custom_font) )StringResource To display a localized string in your Compose Multiplatform UI, use the stringResource function with the ID of the string resource you want to use: Text(text = stringResource(MR.strings.hello_world))ColorResource To set the color of a Compose Multiplatform component, use the ColorResource class with the ID of the color resource you want to use: Text( text = "Hello, World!", color = colorResource(MR.colors.background) )AssetResource To load the contents of an asset file in your Compose Multiplatform UI, use the AssetResource and extension function: val assetConten