# Add dependencies to your Kotlin Notebook Note: Starting with IntelliJ IDEA 2026.2, Kotlin Notebook will no longer be bundled with the IDE or officially supported by JetBrains. The source code will remain available on [GitHub](https://github.com/Kotlin/kotlin-notebook). Learn more in the [blog post](https://blog.jetbrains.com/idea/2026/06/kotlin-notebook-sunset/). You've already created your first [Kotlin Notebook](kotlin-notebook-overview.html)! Now let's learn how to add dependencies to libraries, which is necessary to unlock advanced features. Note: The Kotlin standard library can be used out of the box, so you don't have to import it. You can load any library from the Maven repository by specifying its coordinates using Gradle-style syntax in any code cell. However, Kotlin Notebook has a simplified method to load popular libraries in the form of the [%use statement](https://www.jetbrains.com/help/idea/kotlin-notebook.html#import-libraries): ```KOTLIN // Replace libraryName with the library dependency you want to add %use libraryName // Specify a version, if required %use libraryName(version) // Add v= to trigger autocomplete %use libraryName(v=version) // Example: kotlinx.datetime:0.7.1 %use datetime(v=0.7.1) ``` You can also use the autocompletion feature in Kotlin Notebook to quickly access available libraries: ![Autocompletion feature in Kotlin Notebook](images/autocompletion-feature-notebook.png) Note: Kotlin Notebook has a set of integrated libraries to perform various tasks, from deep learning to HTTP networking. See [Import supported libraries](https://www.jetbrains.com/help/idea/kotlin-notebook.html#import-libraries). You can also add and use libraries that are not yet integrated into Kotlin Notebook. See [Integrate new libraries](https://www.jetbrains.com/help/idea/kotlin-notebook.html#integrate-new-libraries). ## Add Kotlin DataFrame and Kandy libraries to your Kotlin Notebook Let's add two popular Kotlin library dependencies to your Kotlin Notebook: * The [Kotlin DataFrame library](https://kotlin.github.io/dataframe/home.html) gives you the power to manipulate data in your Kotlin projects. You can use it to retrieve data from [APIs](data-analysis-work-with-api.html), [SQL databases](data-analysis-connect-to-db.html), and [various file formats](data-analysis-work-with-data-sources.html), such as CSV or JSON. * The [Kandy library](https://kotlin.github.io/kandy/welcome.html) provides a powerful and flexible DSL for [creating charts](data-analysis-visualization.html). To add these libraries: 1. Click Add Code Cell to create a new code cell. 2. Enter the following code in the code cell: ```KOTLIN // Ensures that the latest available library versions are used %useLatestDescriptors // Imports the Kotlin DataFrame library %use dataframe // Imports the Kotlin Kandy library %use kandy ``` 3. Run the code cell. When a `%use` statement is executed, it downloads the library dependencies and adds the default imports to your notebook. Note: Make sure to run the code cell with the `%use libraryName` line before you run any other code cells that rely on the library. 4. To import data from a CSV file using the Kotlin DataFrame library, use the `.read()` function in a new code cell: ```KOTLIN // Creates a DataFrame by importing data from the "netflix_titles.csv" file. val rawDf = DataFrame.read("netflix_titles.csv") // Displays the raw DataFrame data rawDf ``` Tip: You can download this example CSV from the [Kotlin DataFrame examples GitHub repository](https://github.com/Kotlin/dataframe/blob/master/examples/notebooks/netflix/netflix_titles.csv). Add it to your project directory. ![Using DataFrame to display data](images/add-dataframe-dependency.png) 5. In a new code cell, use the `.plot` method to visually represent the distribution of TV shows and Movies in your DataFrame: ```KOTLIN rawDf // Counts the occurrences of each unique value in the column named "type" .valueCounts(sort = false) { type } // Visualizes data in a bar chart specifying the colors .plot { bars { x(type) y("count") fillColor(type) { scale = categorical(range = listOf(Color.hex("#00BCD4"), Color.hex("#009688"))) } } // Configures the layout of the chart and sets the title layout { title = "Count of TV Shows and Movies" size = 900 to 550 } } ``` The resulting chart: ![Visualization using the Kandy library](images/kandy-library.png) Congratulations on adding and utilizing these libraries in your Kotlin Notebook! This is just a glimpse into what you can achieve with Kotlin Notebook and its [supported libraries](data-analysis-libraries.html). * [Previous step](kotlin-notebook-create.html) ## What's next * Learn how to [share your Kotlin Notebook](kotlin-notebook-share.html) * See more details about [adding dependencies to your Kotlin Notebook](https://www.jetbrains.com/help/idea/kotlin-notebook.html#add-dependencies) * For a more extensive guide using the Kotlin DataFrame library, see [Retrieve data from files](data-analysis-work-with-data-sources.html) * For an extensive overview of tools and resources available for data science and analysis in Kotlin, see [Kotlin and Java libraries for data analysis](data-analysis-libraries.html)