Furiganable is a simple and flexible library for adding furigana (phonetic readings) to text components. Itโs designed to be easy to use.
This library is heavily inspired by the android-compose-furigana library.
- Compatible with Compose Multiplatform (Android, iOS)
- Compatible with both Material 2 and Material 3 libraries
- Easily add furigana by using a simple predefined format, such as
[ๆผขๅญ[ใใใ]]. - Supports Localization
This library consists of three modules: compose-core, compose-m2, and compose-m3. Including just one of them is sufficient. Both compose-m2 and compose-m3 already include compose-core.
| Module | Recommended | Description | Use Case |
|---|---|---|---|
compose-core |
- | A minimal core module with no dependency on Material libraries. Requires passing additional parameters to components. | Ideal for projects that avoid using Material libraries. |
compose-m2 |
โ | Designed for projects using the Material 2 library. | Use if your project relies on Material 2. |
compose-m3 |
โ | Designed for projects using the Material 3 library. | Use if your project relies on Material 3. |
To force isFallbackLineSpacing = false for furigana text, the library swaps Jetpack Composeโs Text composable for an AndroidTextView in certain paths. As a consequence, some Text-related parameters are currently ignored.
Unsupported at the moment
- TextStyle:
textMotion - Text composable args:
onTextLayout
If you depend on these APIs, the library may not yet meet your requirements. PRs welcome.
When using lineHeightStyle with any trim option other than LineHeightStyle.Trim.None, text with furigana becomes misaligned compared to text without furigana.
This fork is published through JitPack rather than Maven Central. JitPack builds the library directly from the Git commit or tag you specify.
- Add the JitPack repository:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}- Add the dependency for the module you want. Replace
TAGwith a tag name, commit hash, ormain-SNAPSHOT.
If you're using Version Catalog, add the following to your libs.versions.toml file:
[versions]
furiganable = "TAG"
[libraries]
furiganable-core = { module = "com.github.yomihon.Furiganable:compose-core", version.ref = "furiganable" }
furiganable-m2 = { module = "com.github.yomihon.Furiganable:compose-m2", version.ref = "furiganable" }
furiganable-m3 = { module = "com.github.yomihon.Furiganable:compose-m3", version.ref = "furiganable" }dependencies {
implementation(libs.furiganable-m3)
}dependencies {
implementation("com.github.yomihon.Furiganable:compose-m3:TAG")
}dependencies {
implementation 'com.github.yomihon.Furiganable:compose-m3:TAG'
}Choose compose-core, compose-m2, or compose-m3 depending on which API surface you want.
The format to add furigana is like, [ๆผขๅญ[ใใใ]].
To recognize the start and end positions of kanji, outer brackets are required.
@Composable
fun SampleComponent() {
// ...
// I want to add furigana to this Text component
Text(
text = "ใใใฏ่ฉฆ้จ็จใฎๆๅญๅใงใใ",
)
}@Composable
fun SampleComponent() {
// ...
// Replace Text component with TextWithReading component
TextWithReading(
formattedText = "ใใใฏ[่ฉฆ้จ็จ[ใใใใใ]]ใฎ[ๆๅญๅ[ใใใใค]]ใงใใ",
)
}You can use localized string for text with furigana like below.
In strings.xml(ja),
<string name="sample_text">ใใใฏ[่ฉฆ้จ็จ[ใใใใใ]]ใฎ[ๆๅญๅ[ใใใใค]]ใงใใ</string>In your composable function,
@Composable
fun SampleComponent() {
// ...
// You can use localized string with furigana
TextWithReading(
formattedText = stringResource(R.string.sample_text),
)
}You can customize the appearance of the furigana text by passing additional parameters to the
TextWithReadingCore, TextWithReading(m2), or TextWithReading(m3) components:
-
furiganaEnabled:
Whether to enable furigana.
Iffalse, a normal text component is used. -
furiganaGap:
Space between the main text and the furigana.
Defaults tostyle.fontSize * 0.03fif unspecified. -
furiganaFontSize:
Font size for the furigana text.
Defaults tostyle.fontSize * 0.45fif unspecified. -
furiganaLineHeight:
Line height for the furigana text.
Defaults tofuriganaFontSizeif unspecified. -
furiganaLetterSpacing:
Letter spacing for the furigana text.
Defaults to-style.fontSize * 0.03fif unspecified.
See demo app code for more examples.
Copyright 2026 turtlekazu
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.





