Planning a trip to Bali in June means treating yourself to a true escape to one of the most dazzling jewels of the Indonesian archipelago. This month marks the peak of the dry season, offering an idyllic setting where azure skies meet lush landscapes and crystal-clear waters. Far from the whims of the monsoons, it’s a blessed time to explore the Island of the Gods, whether you’re seeking thrilling adventures, moments of absolute relaxation on pristine beaches, or a deep immersion in a vibrant, ancient culture. Gentle breezes and pleasant temperatures transform every exploration into pure bliss, inviting travelers to discover the natural and spiritual richness of this extraordinary destination. The calendar of festivities comes alive, offering authentic experiences that will be etched in your memory, far beyond photographic recollections. This is the perfect time to plan a trip that combines wonder and discovery, with the promise of perfect weather as your main ally. A stay in Bali in June is a true invitation to contemplation and adventure, a time when the island reveals all its splendor without artifice, just pure beauty.

Plan every detail of your trip to Bali It becomes an integral part of the adventure, a kind of pre-flight check where every detail is verified to ensure a smooth landing and a seamless stay. From selecting accommodations and creating personalized itineraries to understanding local customs, every choice contributes to crafting a unique experience. Meticulous preparation is key to maximizing every moment on this magical island. It’s not just a trip; it’s a total immersion in a way of life, a philosophy, and breathtaking landscapes. June offers the perfect window to navigate between terraced rice paddies, sacred temples, and majestic volcanoes, all while basking in abundant sunshine. It guarantees a fulfilling tourism experience, where each day is a new page in a travel journal filled with wonder, and where expert advice becomes invaluable for optimizing every discovery. The Island of the Gods awaits you, ready to reveal its many faces under a June sky. In short: ☀️ June in Bali guarantees ideal weather with little rain and mild temperatures for all your activities.

🎭 Prepare for an intense cultural immersion with the Bali Arts Festival, a major event not to be missed.

  • 🏖️ The beaches are at their peak, perfect for relaxation, swimming, or water sports like diving and surfing. 🗓️ It’s a popular time of year, so planning your trip and accommodation in advance is essential for a successful stay.
  • 💰 The budget may be slightly higher due to the high season, but the unique experiences are well worth it. ✈️ Don’t underestimate the importance of local tips to find the best spots and avoid the pitfalls of mass tourism. Bali in June: exceptional weather for unforgettable adventures
  • Going on a trip to Bali A trip to Bali in June means choosing the assurance of dream weather, the kind that transforms each day into a promise of exploration and relaxation under a generous sun. This month marks the heart of the dry season, a time when the sky is a brilliant blue and rainfall is rare, if not nonexistent. This is a key factor for the success of your trip, because good weather allows you to fully enjoy all the activities the island has to offer, without the unexpected interruptions of tropical downpours. Temperatures are pleasant, generally ranging between 25 and 30 degrees Celsius, offering comfortable warmth without being oppressive. Humidity, often high in tropical regions, is significantly lower in June, making the atmosphere much more breathable and long days of exploration more enjoyable. This comfortable climate is a real advantage, and that’s why we highly recommend this time to discover the Island of the Gods. Imagine mornings where sunlight filters gently through coconut palms, inviting you to swim in turquoise waters or stroll along fine sandy beaches. The lack of prolonged rain in June also means that hiking trails are dry and accessible, paving the way for excursions to majestic volcanoes like Mount Batur or through the famous Jatiluwih and Tegallalang rice terraces. The beaches
  • Whether white or black volcanic sand, the beaches are at their peak, perfect for relaxing, surfing, or diving. Underwater visibility is excellent thanks to clear, calm waters, offering ideal conditions for exploring the rich marine life of Bali. The coral reefs teem with life, with a multitude of tropical fish, turtles, and, with a bit of luck, manta rays gliding gracefully in the current. It’s an underwater spectacle we truly loved, and which, under the June sun, takes on an even more spectacular dimension. It’s easy to understand why tourism is booming at this time of year: everything is in place for a flawless experience. Furthermore, the low humidity in June is a significant advantage for travelers who dislike the sweltering heat of the tropics. This allows you to feel more at ease, whether you’re strolling through the bustling markets of Ubud, exploring ancient temples, or participating in open-air yoga classes. The evenings are mild and ideal for al fresco dining, with a gentle breeze providing welcome relief after a sunny day. The night sky is often clear, offering breathtaking views of the stars—a spectacle that, from the heights of a villa or the terrace of a seaside restaurant, is simply stunning. For photographers, the light in June is particularly beautiful and consistent, without the gray or stormy skies that can ruin a shot. Every sunrise and sunset becomes a living painting, moments not to be missed to capture the beauty of Bali. It’s the perfect time to keep your camera close at hand, because the island is a true muse. It’s also a time when you can truly feel connected to the island. The radiant sunshine and constant, yet bearable, warmth create an atmosphere conducive to relaxation and escape. We found that this facilitated interactions with the locals, who are always smiling and welcoming, and encouraged us to venture off the beaten path. The stable climate in June allows for flexibility in plans, without the need for backup plans in case of bad weather. You can spontaneously decide on an excursion, a surf session, or a temple visit without worrying about the weather. This is what we look for in a trip: freedom and the ability to live in the moment. Local advice often confirmed that June is the best month to enjoy all of this. If you have the budget to travel at this time, don’t hesitate, because the conditions are optimal for a successful stay where each day is a new discovery and happiness is around every corner. Remember to stay hydrated and protect yourself from the sun, because even though the heat is pleasant, the sun’s rays are intense, especially during the day. A hat, sunglasses, and biodegradable sunscreen are essential companions for all your outings. Another advantage of June is that the air is drier, which limits the proliferation of certain insects—a small detail that makes the stay even more enjoyable. This clear sky is a blessing for air travel, and as a pilot, I can tell you that a flight without turbulence and with an unobstructed view is what we prefer! It’s a similar feeling to a trip to Bali. In June: everything is aligned for the smoothest and most beautiful experience possible. We took advantage of every ray of sunshine to discover hidden corners, authentic warungs (local eateries), and breathtaking landscapes, proving that this month is truly the ideal time for total immersion in Balinese magic. The June climate is a guaranteed hit for a cloudless trip.
  • Balinese cultural immersion in June: the Festival of Living Arts and Traditions
  • June in Bali isn’t just synonymous with perfect weather for the beaches and outdoor activities; it’s also an incredibly rich period for culture, marking the peak of traditional festivities and artistic expression. The highlight of this vibrant atmosphere is undoubtedly the famous Bali Arts Festival (Pesta Kesenian Bali), which takes place every year in Denpasar. It’s a large-scale event, a vibrant celebration that attracts artists from all over the island and even from other parts of Indonesia, offering visitors a unique opportunity to delve into the heart of the Balinese soul. In 2026, as every year, this festival promises breathtaking performances and an authentic immersion in the island’s artistic heritage. We were lucky enough to experience it, and it’s a whirlwind of colors, sounds, and emotions that captivates you from the very first minutes. It’s not just a series of performances; it’s a true window into Balinese identity. At the heart of the Bali Arts Festival are the dance performances They occupy a prominent place. From local troupes, sometimes composed of children barely out of childhood, to seasoned artists, they perform in flamboyant costumes adorned with gold and shimmering silks. Every movement, every gesture, every facial expression tells a mythological story, an episode from the epic Ramayana or ancestral tales. The Legong, the Barong, the Kecak, or the Baris—each dance is a living work of art, executed with a precision and grace that testify to years of training and devotion. To witness these performances is to see Balinese history and spirituality come alive before your eyes. It’s truly wonderful to feel the energy of the audience, the scent of incense, and the music of the gamelan, which create an almost magical atmosphere. For culture enthusiasts, this is an opportunity not to be missed. We recommend checking the detailed program in advance so you don’t miss your favorite shows.

Beyond the dances, the festival is also a vast field for art exhibitions and crafts. From woodcarvers to painters, weavers to goldsmiths, Balinese artisans showcase their meticulous and often spiritually imbued work. You’ll discover intricate sculptures depicting deities or mythological creatures, vibrant paintings capturing scenes of daily life or Balinese landscapes, and traditional textiles like ikat and songket, whose patterns tell stories. It’s the perfect place to find unique and authentic souvenirs, far removed from mass production, while supporting the local economy and artisans. We loved strolling through these aisles, admiring the skill and creativity, and exchanging a few words with the artists, who are often delighted to share their expertise. It’s an immersion in the creative process that is just as enriching as acquiring an object. Responsible tourism also involves these authentic encounters. The musical performances , primarily by Gamelan orchestras, are the beating heart of the festival. The Gamelan, with its bronze percussion instruments, flutes, and strings, creates hypnotic and complex melodies that accompany most of the dances and ceremonies. Listening to a live Gamelan performance is a profound sonic experience, a true immersion into the musical soul of Balinese culture. Beyond the festival, the month of June is also marked by numerous

Hindu ceremonies in local temples. Often, a simple stroll will lead you to a colorful procession, an offering, or a purification ceremony. These events offer a unique opportunity to discover Balinese spirituality, an essential facet of the island. It’s fascinating to see how religion is omnipresent in the daily lives of the Balinese and how it manifests itself through these beautiful and meaningful rituals. If you are fortunate enough to be invited to one of these ceremonies, remember to dress respectfully (sarong and sash) and follow the advice of your hosts. It’s a truly unique experience, an aspect of travel that leaves a lasting impression and deeply moved us. It’s where you understand why Bali is called the Island of the Gods. For more information on spiritual life and traditions, we recommend visiting the Foundations of Sovereignty and the Rule of Law, which sheds light on the importance of cultural values. The Bali Arts Festival is not just an event for locals; it has become an international attraction, drawing artists and spectators from all over the world, making this month a time of great creativity and cultural exchange. The synergy between ancestral traditions and contemporary influences is palpable, showing that Balinese culture is alive and constantly evolving. It is this blend that makes Bali so fascinating. Innovative performances reinterpreting traditional art forms were discovered, proving that culture is never static. It is a joy to see this richness flourish under the June sun, and it reminds us of the importance of preserving and celebrating these heritages.To make the most of these festivities, arrive early for popular performances, remain open to impromptu discoveries, and fully immerse yourself in the atmosphere. This is a part of your trip that will stay with you, far beyond the visual memories of paradise beaches. It’s the soul of Bali that is revealed, and it’s simply wonderful to witness it. https://www.youtube.com/watch?v=XC6b48E5Zto

Activities and explorations in Bali in June: between rice paddies, temples, and underwater worlds With such mild weather in June, Bali becomes an ideal playground for a multitude of activities and explorations. Far from the postcard images of beaches, the island offers a diversity of landscapes that invite adventure and discovery. Whether you’re seeking thrills, spirituality, or moments of pure wonder in nature, June is the perfect month for all kinds of experiences. We’ve explored the island from every angle, and we can assure you there’s something for everyone. From volcanic peaks to the depths of the ocean, every corner of the island holds hidden treasures. It’s a true paradise for tourism, where each day can be planned differently, depending on your desires and the tips you gather during your stay. Get ready for a busy schedule, because there’s so much to see and do!Exploring the underwater world and water sports

June is the perfect time for diving and snorkeling enthusiasts. Calm waters and exceptional visibility offer optimal conditions for exploring coral reefs teeming with marine life. Sites like Nusa Penida, with its majestic manta rays, and the famous Crystal Bay dive site are must-sees. We swam alongside these gentle giants of the ocean, and it was a truly unique experience, an absolute highlight. In Amed or Tulamben, you can explore the wreck of the Liberty, an American warship sunk during World War II, transformed into an artificial reef and home to incredible biodiversity. It’s fascinating to see how nature reclaims its territory. For surfers, the waves on Bali’s south coast, particularly at Uluwatu, Padang Padang, and Canggu, are perfect for all levels, from beginners to experienced surfers. The dry climate in June ensures favorable wind conditions and plenty of sunshine for surfing. Don’t forget surf lessons if you’re a beginner; it’s a great way to get started with this iconic sport of the local culture. I highly recommend trying it, even just for an introductory lesson—you’re guaranteed to have a blast! Exploring the inland landscapes: rice paddies, volcanoes, and waterfalls The interior of Bali It’s a verdant paradise, and in June, these landscapes are at their most beautiful. The terraced rice paddies, like those of Jatiluwih (a UNESCO World Heritage Site) or Tegallalang near Ubud, are a vibrant green, offering breathtaking panoramas. We loved strolling through these landscapes, discovering the traditional Subak irrigation system, and meeting the farmers. It’s a peaceful walk, far from the hustle and bustle of the coastal areas. For the more adventurous, climbing volcanoes like Mount Batur to admire the sunrise is an unforgettable experience. The trail is dry and easier to access than during the rainy season. Setting off before dawn to reach the summit at sunrise and see the colors explode on the horizon is fantastic. Waterfalls, like Gitgit or Sekumpul, are also worth visiting in June. Even if they are less powerful than during the wet season, access is much safer and more pleasant. The dry climate allows you to fully enjoy these natural wonders without worrying about slips or muddy paths. It’s the perfect time for long hikes and to soak in the lush surroundings. Cultural and spiritual visits: temples and traditional villages A trip to Bali wouldn’t be complete without exploring its sacred temples. In June, the beautiful weather makes these visits much easier. Uluwatu Temple, perched on a cliff with breathtaking ocean views, is particularly spectacular at sunset, especially with the Kecak dance performance. Tanah Lot, another iconic sea temple, is accessible at low tide, offering magnificent views. The Besakih Mother Temple, the largest and most sacred in Bali, is also a must-see. This is also an essential visit to understand the depth of Balinese spirituality. We were amazed by the architecture and the atmosphere. Exploring traditional villages like Penglipuran or Tirta Gangga, with its royal water gardens, allows you to immerse yourself in the local culture and observe the Balinese way of life. The advice we always give: dress respectfully (shoulders and knees covered) and be mindful of local customs. This trip is a unique opportunity to connect with a rich spirituality and living traditions. Cultural tourism is very popular in Bali, and for good reason: there is an incredible wealth of things to discover. Don’t forget to check out our guide to exploring Bali as a family, which offers ideas for all ages and practical advice. Things to Do in Bali in June: Your Interactive Guide

Reset “Discover Bali’s treasures in June with this interactive guide. Click on the headings to sort!” Preparing Your Trip to Bali: Essential Tips for a Smooth Stay in 2026 Planning a trip to Bali, especially for a stay in June, requires some advance planning. In 2026, if tourism conditions remain similar to previous years, June will still be a high season due to its idyllic climate. This means that demand for flights and accommodations is higher, and prices may be slightly higher. But don’t panic! With the right advice and methodical preparation, you can optimize your budget and ensure a successful, stress-free stay. Think of your trip like a flight plan: each step must be carefully considered for a smooth landing and seamless exploration. This ensures you can fully enjoy all the activities and rich cultural heritage of Bali. We’ve often seen travelers arrive unprepared and find themselves a bit overwhelmed, so we’re telling you everything you need to know to fly to the Island of the Gods with complete peace of mind. Booking flights and accommodations: planning ahead is key. As soon as your travel dates for June are set, the first thing to do is book your flights. Prices are often better several months in advance. We advise you to keep an eye on airline offers and be flexible with your departure and return dates if possible, as a few days’ difference can sometimes make a big difference to the price. For accommodation, Bali offers an incredible range of options, from luxurious villas to charming guesthouses, and hotels of all categories. In June, the best establishments, especially those located near the beaches or in popular areas like Ubud or Seminyak, book up quickly. If you have a favorite hotel or villa, don’t delay. Using online booking platforms is a good idea, but don’t hesitate to check directly on the establishments’ websites; sometimes they offer special deals. If you’re looking for inspiration for a sunny getaway, you might find some interesting ideas by consulting this article on budget-friendly sunny destinations even if the context is different, the planning philosophy is similar. For families, there are perfect options, with villas equipped with private pools or resorts with kids’ clubs, allowing everyone to enjoy their stay at their own pace. Administrative formalities and health: the essentials

Before you leave, make sure your passport is valid for at least six months after your planned return date. Visa regulations may change, but by 2026, most travelers will likely be able to obtain a visa on arrival or an e-visa in advance. Check the latest requirements with the Indonesian embassy or consulate in your country to avoid any surprises. This is crucial, as access to the island depends on these formalities. Regarding health, consult your doctor about recommended vaccinations (Hepatitis A and B, typhoid, DTPolio) and discuss the need for malaria prophylaxis, even though the risk is low in Bali. Good travel insurance is also essential to cover any potential medical issues or trip cancellations. We strongly advise you to purchase insurance that includes coverage for the activities you plan to do (diving, surfing, etc.). Remember to pack a small first-aid kit with basic medications, bandages, antiseptic, and effective mosquito repellent, even though June is less conducive to mosquitoes thanks to a drier climate. Basic hygiene is also important: opt for bottled water and wash your hands frequently—simple but effective tips for a worry-free stay. Local transportation and money: navigating the island

Getting around Bali Several options are available. Renting a scooter is very popular and offers great freedom, but requires caution and experience. The roads can be chaotic and traffic heavy. If you choose this option, make sure you have an international driving permit and wear a helmet. It’s a great way to discover the island at your own pace, but safety is paramount. Alternatively, hiring a private driver for the day or for transfers is very affordable and comfortable, especially if you are traveling in a group or with family. Ride-hailing apps like Gojek or Grab are also very convenient and economical for short trips. The local currency is the Indonesian Rupiah (IDR). It’s recommended that you always carry some cash for small expenses, markets, or local warungs (food stalls). Credit cards are accepted in most hotels, restaurants, and department stores, and you’ll find ATMs everywhere. Inform your bank of your trip abroad to avoid having your cards blocked. Balinese culture values ​​haggling in markets, so don’t hesitate to negotiate prices; it’s an activity in its own right! For tips on managing your budget, you can read our advice on reducing the cost of your mobile plans, a similar approach to optimizing travel expenses. Communication and respect for customs: connecting with the island

To stay connected, buying a local SIM card at the airport or in specialized shops is very easy and inexpensive, providing mobile data for browsing the internet and using transportation apps. This greatly simplifies the logistics of your trip. Regarding the cultureThe Balinese are incredibly respectful and expect the same from their visitors. Learn a few words of Bahasa Indonesia (thank you = terima kasih, hello = selamat pagi), it will always be appreciated. When visiting temples, wear appropriate clothing (shoulders and knees covered) and use a sarong, often provided at the entrance. Never climb on altars or statues. Offerings (canang sari) are everywhere; avoid stepping on them. Hand gestures are important: never point and use your right hand to give or receive. These simple, common-sense tips contribute to harmonious and respectful interactions, enriching your trip and your tourism experience. It’s a continuous learning process, but essential for fully appreciating Balinese kindness and hospitality. The climate in June is perfect for these outdoor interactions, without the discomfort of excessive heat and humidity. Exploring Bali’s Hidden Treasures in June: Off-the-Beaten-Path Itineraries

While Bali is renowned for its iconic beaches and bustling tourist attractions, June offers the opportunity to venture off the beaten path and discover hidden gems, far from the crowds. With ideal weather and a touch of curiosity, your trip can transform into a true treasure hunt, revealing a more authentic and serene side of the Island of the Gods. This is where travel takes on a more personal dimension, where every discovery is a reward. We’ve always loved unearthing these hidden gems, these places where we feel privileged to be, and we’re sharing our tips for a more intimate and emotionally richer experience. These are activities that are out of the ordinary and promise unforgettable memories. The goal is to get away from the crowds and find true Balinese bliss.Munduk and Sidemen: The Serenity of Mountains and Valleys North of Bali, the Munduk region is a haven of peace nestled in the mountains. Far from the coastal areas, it offers a cooler climate and spectacular landscapes of waterfalls, coffee plantations, and less-visited terraced rice paddies. In June, the hiking trails are perfectly accessible, allowing you to explore the lush nature and discover impressive waterfalls like Munduk or Banyumala Falls. We loved the feeling of coolness and tranquility; it’s a striking contrast to the heat of the southern beaches. Accommodations are often eco-lodges or charming guesthouses, offering panoramic views of the verdant valleys. It’s the ideal place to recharge and enjoy authentic rural culture. Further east, the Sidemen Valley is another hidden gem. With its rolling rice paddies, traditional villages, and the majestic silhouette of Mount Agung as a backdrop, Sidemen is a living painting. Activities here are nature-focused: cycling through the rice fields, taking Balinese cooking classes with fresh garden ingredients, or simply contemplating the scenery. It’s a place to slow down, connect with nature, and experience the kindness of the locals. We highly recommend spending a few days here for a truly immersive experience. If you prefer quieter, more authentic destinations, you might also consider options like

exploring the Canary Islands in May , for diverse natural landscapes. Amed and Candidasa: Authentic charms of the East Coast On the east coast of Bali The fishing villages of Amed and Candidasa offer a more relaxed and traditional atmosphere than the larger beach resorts. Amed is particularly renowned for its diving and snorkeling sites, with calm waters in June and exceptional visibility. You can explore shipwrecks, such as the Japanese ship, and abundant coral reefs, all just a few meters from the shore. The beaches are often made of black volcanic sand, offering a striking contrast to the turquoise blue of the ocean. It’s a place where time seems to slow down, where you can watch fishermen head out to sea in their traditional jukungs at sunrise. Candidasa, further south, is a small coastal town with a lake at its center and ancient temples. It’s an ideal base for exploring eastern Bali, including the Tirta Gangga Water Palace and the Ujung Water Palace. Tourism is less developed here, allowing for more authentic interactions with Balinese people and a deeper immersion in the local culture. It’s a perfect choice for those seeking a peaceful, discovery-focused, and relaxing stay, with local tips on finding the best fresh seafood restaurants. Wellness and Culinary Experiences: Nourishing Body and Mind Beyond the iconic sites, Bali is also a global center for wellness and gastronomy. In June, the beautiful weather encourages outdoor activities like yoga or meditation. Numerous retreats and studios offer classes for all levels, often in stunning settings overlooking rice paddies or the ocean. It’s a great way to recharge and reconnect with yourself. For cooking, take a Balinese cooking class. It’s a fun and flavorful immersion in the culture. local. You learn to prepare traditional dishes like Nasi Goreng, Mie Goreng, or Satay, using spices and fresh market produce. It’s a really great activity to do with friends or family, and the joy of eating what you’ve prepared is incomparable. We did it and loved it! Don’t hesitate to explore the warungs, these small local restaurants that serve delicious and authentic cuisine at unbeatable prices. This is where you discover the true flavors of Bali . Travel

is also a culinary adventure, and Balinever disappoints. We’ll tell you all about it: try Babi Guling (roast suckling pig) and Bebek Betutu (spiced stuffed duck), specialties you absolutely shouldn’t miss if you love meat. For more culinary and travel inspiration, discover the must-sees of Mallorca in June , where you’ll find a similar approach to enjoying the local gastronomy and activities. Towards Sustainable Tourism: Preserving Bali’s Beauty Finally, when exploring Bali’s hidden treasures in June, it’s crucial to adopt a sustainable tourism approach. The island is beautiful, but it’s also fragile. Consider reducing your plastic consumption by using a reusable water bottle, supporting local businesses and artisans, and respecting the environment and Balinese culture. Bali’s natural beauty and traditions are what make it so special, and it’s our responsibility to protect them for future generations. Tips for a more respectful stay include leaving no trace, participating in clean-up initiatives when possible, and being mindful of the impact of our actions. June’s favorable weather makes it easier to engage in outdoor activities and awareness-raising. It’s a trip which can be both personally enriching and beneficial for the planet, a way to leave a positive, carbon-neutral footprint. Adopting this philosophy is truly wonderful and allows for an even deeper and more meaningful experience in Bali. https://www.youtube.com/watch?v=L82xEmQ6An4 Why is June the best month to visit Bali? June is the best month because of the dry season, offering ideal weather with little rain, pleasant temperatures, and low humidity. This makes all outdoor activities, from beaches to hiking, much more comfortable and enjoyable. What are the must-see cultural activities in Bali in June? The Bali Arts Festival is the major cultural event in June, featuring traditional dance performances, art exhibitions, and musical performances. It’s a unique opportunity to immerse yourself in the island’s rich cultural and spiritual heritage. What are the essential tips for planning your travel budget in June?

June being peak season, it’s crucial to book your flights and accommodations in advance to get the best rates. Carry some cash for small expenses and local markets, and use ride-sharing apps for budget-friendly journeys.

Can you find quieter, less crowded places in Bali in June?

Yes, despite the peak season, areas like Munduk, Sidemen, Amed, and Candidasa offer a more peaceful and authentic atmosphere. These areas are ideal for hiking, exploring traditional villages, and enjoying wellness experiences away from the crowds. How can I get around Bali efficiently during my stay in June? Renting a scooter is popular for its freedom, but be careful. Private driver services are affordable and comfortable for longer distances or excursions. Ride-hailing apps like Gojek or Grab are very convenient for short trips around town.

// — Données pour le tableau comparatif — // Ces données sont fournies par l’utilisateur et sont intégrées directement. // Aucune API externe n’est nécessaire pour le contenu du tableau. const baliData = { “title”: “Activités à Bali en juin”, “headers”: [“Activité”, “Intérêt en juin”, “Meilleurs spots”], “rows”: [ [“Plongée sous-marine”, “Visibilité maximale, eaux calmes”, “Nusa Penida, Amed, Tulamben”], [“Surf”, “Vagues consistantes, temps ensoleillé”, “Uluwatu, Canggu, Padang Padang”], [“Randonnée volcanique”, “Sentiers secs, vues dégagées”, “Mont Batur, Mont Agung”], [“Visite des rizières”, “Couleur verte éclatante, accessible”, “Jatiluwih, Tegallalang”], [“Exploration de temples”, “Climat idéal pour les visites”, “Uluwatu, Tanah Lot, Besakih”] ] }; // — Références aux éléments du DOM — const tableHeaders = document.getElementById(‘table-headers’); const tableBody = document.getElementById(‘table-body’); const searchInput = document.getElementById(‘searchInput’); const resetButton = document.getElementById(‘resetButton’); // — Variables d’état pour le tri et la recherche — let currentSortColumn = -1; // Index de la colonne actuellement triée (-1 si aucune) let sortDirection = ‘asc’; // Direction du tri : ‘asc’ (ascendant) ou ‘desc’ (descendant) let initialData = […baliData.rows]; // Copie originale et immuable des données let filteredData = […initialData]; // Copie mutable des données pour le filtrage et le tri // — Fonctions utilitaires — /** * Génère et affiche le corps du tableau avec les données fournies. * @param {Array<Array>} dataToDisplay – Les lignes de données à afficher dans le tableau. */ function renderTable(dataToDisplay) { tableBody.innerHTML = ”; // Vide le corps du tableau avant de le remplir if (dataToDisplay.length === 0) { // Affiche un message si aucune donnée ne correspond à la recherche ou au filtre. tableBody.innerHTML = `Aucune activité trouvée pour votre recherche.`; return; } dataToDisplay.forEach((rowData, index) => { const row = document.createElement(‘tr’); // Applique un style alterné aux lignes pour une meilleure lisibilité. row.classList.add(‘hover:bg-green-50’, index % 2 === 0 ? ‘bg-white’ : ‘bg-gray-50’); rowData.forEach(cellData => { const cell = document.createElement(‘td’); // S’assure que le texte ne déborde pas et gère les espaces. cell.classList.add(‘px-6’, ‘py-4’, ‘whitespace-normal’, ‘text-sm’, ‘text-gray-700’); cell.textContent = cellData; row.appendChild(cell); }); tableBody.appendChild(row); }); } /** * Génère les en-têtes du tableau, incluant les icônes de tri interactives. * Les en-têtes sont cliquables pour changer l’ordre de tri. */ function renderHeaders() { tableHeaders.innerHTML = ”; // Vide les en-têtes existants // Icônes SVG pour représenter les différents états de tri. const sortAscIcon = “; // Flèche vers le haut pour ascendant const sortDescIcon = “; // Flèche vers le bas pour descendant const sortNeutralIcon = “; // Double flèche (neutre) baliData.headers.forEach((headerText, index) => { const th = document.createElement(‘th’); th.classList.add(‘px-6’, ‘py-3’, ‘text-left’, ‘text-xs’, ‘font-medium’, ‘text-white’, ‘uppercase’, ‘tracking-wider’, ‘cursor-pointer’, ‘select-none’, ‘hover:bg-green-700’, ‘transition-colors’, ‘duration-200’); th.setAttribute(‘data-column-index’, index); const contentWrapper = document.createElement(‘div’); contentWrapper.classList.add(‘flex’, ‘items-center’, ‘justify-between’); contentWrapper.textContent = headerText; const sortIconSpan = document.createElement(‘span’); sortIconSpan.classList.add(‘ml-2’); // Met à jour l’icône de tri en fonction de l’état actuel (trié ou non, direction). if (currentSortColumn === index) { sortIconSpan.classList.add(‘text-opacity-100’); // Icône pleine couleur si triée sortIconSpan.innerHTML = sortDirection === ‘asc’ ? sortAscIcon : sortDescIcon; } else { sortIconSpan.classList.add(‘text-opacity-40’); // Icône estompée si non triée sortIconSpan.innerHTML = sortNeutralIcon; } contentWrapper.appendChild(sortIconSpan); th.appendChild(contentWrapper); // Ajoute un écouteur d’événement pour le tri au clic sur l’en-tête. th.addEventListener(‘click’, () => handleSort(index)); tableHeaders.appendChild(th); }); } /** * Gère la logique de tri lorsque l’utilisateur clique sur un en-tête de colonne. * @param {number} columnIndex – L’index (base 0) de la colonne à trier. */ function handleSort(columnIndex) { // Si la même colonne est cliquée à nouveau, inverse la direction de tri. if (currentSortColumn === columnIndex) { sortDirection = sortDirection === ‘asc’ ? ‘desc’ : ‘asc’; } else { // Si une nouvelle colonne est cliquée, trie en ordre ascendant par défaut. currentSortColumn = columnIndex; sortDirection = ‘asc’; } // Trie les données filtrées (qui sont les données actuellement affichées ou candidates à l’affichage). filteredData.sort((a, b) => { const valA = String(a[columnIndex]).toLowerCase(); const valB = String(b[columnIndex]).toLowerCase(); if (valA valB) { return sortDirection === ‘asc’ ? 1 : -1; } return 0; }); // Re-rend les en-têtes (pour mettre à jour l’icône de tri) et le corps du tableau. renderHeaders(); renderTable(filteredData); } /** * Filtre les données du tableau en fonction de l’entrée de l’utilisateur dans le champ de recherche. * Le filtre est appliqué aux données originales pour éviter de cumuler les filtres. */ function filterTable() { const searchTerm = searchInput.value.toLowerCase().trim(); if (!searchTerm) { // Si le champ de recherche est vide, utilise toutes les données d’origine. filteredData = […initialData]; } else { // Filtre les données d’origine pour inclure uniquement les lignes // dont une cellule contient le terme de recherche. filteredData = initialData.filter(row => row.some(cell => String(cell).toLowerCase().includes(searchTerm)) ); } // Si une colonne était précédemment triée, réapplique ce tri aux données filtrées. if (currentSortColumn !== -1) { filteredData.sort((a, b) => { const valA = String(a[currentSortColumn]).toLowerCase(); const valB = String(b[currentSortColumn]).toLowerCase(); if (valA valB) return sortDirection === ‘asc’ ? 1 : -1; return 0; }); } renderTable(filteredData); // Affiche le tableau avec les données filtrées et triées. } /** * Réinitialise le tableau à son état initial : aucun terme de recherche, aucun tri appliqué. */ function resetTable() { searchInput.value = ”; // Vide le champ de recherche. currentSortColumn = -1; // Réinitialise l’index de la colonne de tri. sortDirection = ‘asc’; // Réinitialise la direction de tri par défaut. filteredData = […initialData]; // Restaure l’ensemble des données d’origine. renderHeaders(); // Réaffiche les en-têtes sans icône de tri active. renderTable(filteredData); // Affiche le tableau complet et non trié. } // — Initialisation et écouteurs d’événements (exécutés au chargement du DOM) — document.addEventListener(‘DOMContentLoaded’, () => { renderHeaders(); // Génère les en-têtes du tableau. renderTable(filteredData); // Affiche le tableau avec les données initiales. // Écoute les frappes au clavier dans le champ de recherche pour filtrer le tableau en temps réel. searchInput.addEventListener(‘keyup’, filterTable); // Écoute le clic sur le bouton de réinitialisation. resetButton.addEventListener(‘click’, resetTable); // Cette ligne est optionnelle mais peut être utile si Tailwind CSS ne scanne pas automatiquement // les éléments ajoutés dynamiquement ou si le script est chargé d’une manière non standard. // Elle force Tailwind à réévaluer les classes dans le DOM. if (typeof tailwindcss !== ‘undefined’ && typeof tailwindcss.evaluate !== ‘undefined’) { tailwindcss.evaluate(); } });

{“@context”:”https://schema.org”,”@type”:”FAQPage”,”mainEntity”:[{“@type”:”Question”,”name”:”Pourquoi juin est-il le meilleur mois pour visiter Bali ? “,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Juin est le meilleur mois en raison de la saison su00e8che, offrant un climat idu00e9al avec peu de pluie, des tempu00e9ratures agru00e9ables et un faible taux d’humiditu00e9. Cela rend toutes les activitu00e9s de plein air, des plages aux randonnu00e9es, beaucoup plus confortables et agru00e9ables.”}},{“@type”:”Question”,”name”:”Quelles sont les activitu00e9s culturelles incontournables en juin u00e0 Bali ?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Le Festival des Arts de Bali est l’u00e9vu00e9nement culturel majeur en juin, proposant des spectacles de danse traditionnelle, des expositions d’art et des performances musicales. C’est une occasion unique de s’immerger dans la richesse culturelle et spirituelle de l’u00eele.”}},{“@type”:”Question”,”name”:”Quels sont les conseils essentiels pour pru00e9parer son budget de voyage en juin ?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Juin u00e9tant la haute saison, il est crucial de ru00e9server vos vols et hu00e9bergements u00e0 l’avance pour obtenir de meilleurs tarifs. Ayez un peu de liquide sur vous pour les petites du00e9penses et les marchu00e9s locaux, et utilisez les applications de transport pour des trajets u00e9conomiques.”}},{“@type”:”Question”,”name”:”Peut-on trouver des endroits calmes et moins fru00e9quentu00e9s u00e0 Bali en juin ?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Oui, malgru00e9 la haute saison, des ru00e9gions comme Munduk, Sidemen, Amed ou Candidasa offrent une atmosphu00e8re plus paisible et authentique. Ces zones sont idu00e9ales pour la randonnu00e9e, la du00e9couverte de villages traditionnels et les expu00e9riences de bien-u00eatre, loin des foules.”}},{“@type”:”Question”,”name”:”Comment se du00e9placer efficacement u00e0 Bali pendant mon su00e9jour en juin ?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”La location d’un scooter est populaire pour sa libertu00e9, mais soyez prudent. Les services de chauffeurs privu00e9s sont abordables et confortables pour les longues distances ou les excursions. Les applications de VTC comme Gojek ou Grab sont tru00e8s pratiques pour les trajets courts en ville.”}}]}

💚 Cet article vous a été utile ?
🌍
Envie d'en savoir plus sur Madagascar ?

Découvrez notre guide complet — destinations, budget, visa, faune et conseils pratiques pour préparer votre voyage.

Explorer Madagascar → À propos de l'île